Help - Search - Members - Calendar
Full Version: Auto Start A Program
Linuxhelp > Support > Technical Support
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" 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 :-)

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

# 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


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

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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.