Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Auto Start A Program
Thors1982
post Apr 17 2004, 12:56 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 17-April 04
Member No.: 2,790



I am a huge linux newb, I took a course in linux but it didn't help at all.
I am trying to run a program when Linux starts

I am using Mandrake 10.0 with KDE

I am trying to run a program called Synergy, the way I currently run the program is I open the shell and type "synergyc -f 192.169.1.100" then it runs. Is there anyway that I can run this program automatically and if so how? Again I am a newb so more desciprive the better :-)

Thanks
Go to the top of the page
 
+Quote Post
hughesjr
post Apr 17 2004, 06:18 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Ok .... here is a script that should make it start (do all the commands as root):

paste this into a text file named /etc/init.d/synergy

CODE
#!/bin/sh
#
# Synergy:       Starts Synergy
#
# Version:      @(#) /etc/rc.d/init.d/synergy 1.0
#
# chkconfig: 2345 80 20
# description: Starts and stops Synergy at boot time and shutdown.
#
# processname: Synergy
# config:
# hide: true

# Source function library.
. /etc/rc.d/init.d/functions

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

# See how we were called.
case "$1" in
 start)
    gprintf "Starting Synergy: "
    synergyc -f 192.169.1.100
    touch /var/lock/subsys/synergy
    echo
;;
 stop)
    gprintf "Stopping Synergy: "
    killproc synergyc
    rm -f /var/lock/subsys/synergy
    echo
;;
 restart)
    gprintf "Restarting Synergy"
    if [ -f /var/lock/subsys/synergy ]; then
    killproc synergyc
    else
    synergyc -f 192.169.1.100
    touch /var/lock/subsys/xfs
    fi
    echo
;;
 *)
    gprintf "*** Usage: synergy {start|stop|restart}n"
    exit 1
esac

exit 0


After saving it, make it executeable with the command:

chmod 755 /etc/init.d/synergy

then make it start on startup and shutdown with the commands:

chkconfig --level 2345 synergy on
chkconfig --level 016 synergy off


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st October 2017 - 12:51 PM