LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2004, 01:02 PM   #1
flosch
LQ Newbie
 
Registered: Jul 2003
Location: Austria
Distribution: RH9 mdk10 Gentoo!
Posts: 10

Rep: Reputation: 0
start seticlient automatic at boot


Hello community!

I want the Seti-Client start at system Boot with User privilegs. How must I speak to my RedHat 9 Linux Server to enable this?
normally I start the Seti Client within the appropriate directory with
Code:
./setiathome -verbose
after learning about sudo I tried:

Code:
[root@tigger Seti]# sudo -H -b -u flosch ./setiathome
[root@tigger Seti]# SETI@home client.
Platform: i386-pc-linux-gnu-gnulibc2.1
Version: 3.03
but this works only within the appropriate directory:

Code:
[root@tigger Seti]# cd /root/
[root@tigger root]# sudo -H -b -u flosch ./setiathome
sudo: ./setiathome: command not found
so this cannot work:

/etc/rc.d/rc.local
Code:
sudo -H -b -u flosch ./setiathome
and this does not:
Code:
sudo -H -b -u flosch /home/flosch/Seti/./setiathome
any suggestions?

thanks for help!

Flosch
 
Old 04-23-2004, 04:23 PM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
If something is being run by the bootscripts in /etc/rc.d it's already being run with root privilages so you don't need to use sudo. Put all the commands in a script with #!/bin/sh at the top. Make the script executable and put it in /etc/rc.d/init.d then make a symbolic link pointing at the script from /etc/rc.d/rc5.d . Call the symbolic link S60seti and it will be run when you boot to init 5. If you want it to run when you boot to init 3 put the link in /etc/rc.d/rc3.d . The number between the S and the seti affects the order scripts are run. Small numbers are run before big numbers so S01seti will be run first and S99seti last.
Code:
cat > /etc/rc.d/init.d/seti << "EOF"
#!/bin/sh
/home/flosch/Seti/setiathome
EOF
chmod 755 /etc/rc.d/init.d/seti &&
cd /etc/rc.d/init.d &&
ln -sf ../init.d/seti ../rc3.d/S52seti &&
ln -sf ../init.d/seti ../rc4.d/S52seti &&
ln -sf ../init.d/seti ../rc5.d/S52seti
Copy and paste that into a terminal as root and reboot to see if it worked.

Edit - sorry, I posted in haste. I've just read you original post again and I see I missunderstood. Obviously, it makes sense that you'd want setiathome to only run with user privilages. Try setting the user id bit
Code:
chown flosch /home/flosch/Seti/setiathome
chmod 4755 /home/flosch/Seti/setiathome
That way it's always running as though it was started by you, no matter which user runs it.

Last edited by Andrew Benton; 04-23-2004 at 04:32 PM.
 
Old 05-04-2004, 09:04 AM   #3
flosch
LQ Newbie
 
Registered: Jul 2003
Location: Austria
Distribution: RH9 mdk10 Gentoo!
Posts: 10

Original Poster
Rep: Reputation: 0
Hi Andrew!
thanks for your comment!
/etc/rc.d/init.d/seti looks like:
Code:
#!/bin/sh
/home/flosch/Seti/setiathome
and there are symlinks in rc3.d, rc4.d and rc5.d:
Code:
 ls -al /etc/rc.d/rcX.d/S52seti
lrwxrwxrwx    1 root     root           14 May  4 15:19 /etc/rc.d/rc3.d/S52seti -> ../init.d/seti
lrwxrwxrwx    1 root     root           14 May  4 15:21 /etc/rc.d/rc4.d/S52seti -> ../init.d/seti
lrwxrwxrwx    1 root     root           14 May  4 15:21 /etc/rc.d/rc5.d/S52seti -> ../init.d/seti
and at least perms of the client:
Code:
> ls -al /home/flosch/Seti/setiathome
-rwsr-xr-x    1 flosch   flosch     131000 Dec 13  2000 /home/flosch/Seti/setiathome
after reboot the client isn't running but I have the lock.sah file in the /home/flosch/Seti/setiathome directory.

at this point a 'manual start' produces :
Code:
 /etc/rc.d/rc4.d/S52seti
Couldn't get lock file.  This is probably because
another instance of SETI@home is running in this directory.
Each instance of SETI@home must run in a separate directory.
after that I have to del the
Code:
-rw-r--r--    1 flosch   root            0 May  4 15:39 lock.sah file.
and start Seti as it should happend at startup:

Code:
/etc/rc.d/rc4.d/S52seti
> ps aux | grep seti
flosch 2682 92.0 3.7 16832 14380 ? RN 15:55 0:29 [setiathome]

how can I figure out why the client don't start at startup?
thanks for help!

Last edited by flosch; 05-04-2004 at 09:06 AM.
 
Old 05-04-2004, 09:41 AM   #4
jon_k
Member
 
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Rep: Reputation: 30
But isn't running seti (or any other program that doesn't need root) under root highly NOT RECCEMENDED?

What if seti could be exploited to gain access privilages of the user it's run under? That could be diasterious.

Be careful what you run as root.
 
  


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
Automatic Start mohtasham1983 Linux - Newbie 2 05-14-2005 05:02 PM
Automatic start of aMule underberg Linux - Software 4 03-13-2005 09:12 AM
Automatic start of programs? ElPuello Linux - Software 3 04-15-2004 07:15 PM
Automatic Start of XTerm secprovider Linux - Newbie 1 03-30-2004 03:00 AM
Automatic start of program VincentB Linux - Newbie 1 07-03-2003 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:27 AM.

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