LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-02-2006, 01:06 AM   #1
EFiNi7
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Rep: Reputation: 0
How to create script that runs a command on boot up


I have installed synergy on my SUSE 10.1 distro and would like to know how to create a script that runs a command i normally run in a terminal session AFTER i have logged in to my session.

I would like the command to run BEFORE i get to the initial logon window. Where do i put it? How do i create it?

the command i need to run is located in a folder called:

/home/john/apps/usr/bin/

the command is:

./synergyc -f --daemon 161.50.18.207

If anyone can point me in the right direction or tell me exactly how to go about this i would be very grateful
 
Old 08-02-2006, 01:24 AM   #2
pddm
Member
 
Registered: Sep 2005
Distribution: Mint 19.2
Posts: 112

Rep: Reputation: 15
You will have to move your file "synergyc" to a place where it can be executed:

Run in a terminal
Code:
$PATH
you should get somthing like>
Code:
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin:
In your case I think /usr/bin/ is not a bad idea.

Then put the following line into your /etc/rc.d/rc.local

Code:
/usr/bin/synergyc -f --daemon 161.50.18.207
This should do the trick.
 
Old 08-02-2006, 02:40 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
When do you want it to start? If you want it to start just before entering the start level, then add the line to the /etc/init.d/boot.local.
 
Old 08-02-2006, 02:43 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
There should be no need to move the file into /usr/bin or anywhere else. Just make sure the directory /home/john/apps/usr/bin has execute permissions, and the file too.
 
Old 08-03-2006, 06:46 PM   #5
EFiNi7
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
I would like it to start as soon as the login screen comes up so basically when xsession starts. Aparantly synergy needs xsession to be loaded before it will run. Sorry for misinforming you people, but the tips are excellent anyways for in future i may need something to run on boot
 
Old 08-09-2006, 10:43 PM   #6
pddm
Member
 
Registered: Sep 2005
Distribution: Mint 19.2
Posts: 112

Rep: Reputation: 15
Here is some reading Material:

http://yolinux.com/TUTORIALS/LinuxTu...itProcess.html

If your system is configured to boot directly into the login screen, it means that it is configured to to runlevel 4 or 5, depending on your distro (check line 24 in your inittab).

I guess you could add your script at the end of rc.4 or rc.5 depending again on your rullevel setting.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i create a KDE desktop icon which runs a program using a different group-id? jcosenzo Linux - General 3 06-10-2006 09:44 AM
How to Create a Shortcut that runs Eclipse muneebs Linux - Software 2 02-02-2005 04:56 PM
command runs at prompt not in script newbie_m Linux - Newbie 2 01-20-2005 02:12 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
script runs fine from a command line, but doesn't work from cron? kleptophobiac Linux - Software 5 05-03-2004 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration