LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 11-03-2006, 08:59 AM   #1
avijitp
Member
 
Registered: May 2005
Location: India
Distribution: FC11, Debian/Ubuntu, RHEL, Solaris, AIX, HP-UX
Posts: 161

Rep: Reputation: 32
How to run a script with a boot/reboot with the ownership of a user


Hi:

How can we start a script that will be running with the server boot or the server reboot with the ownership of the "user", not as a root.

I am aware that I can add the soft link of the script to the /etc/rc.d/rc.X/ directory , but I need to make sure that it runs with the ownership of the "user", not as a root.
 
Old 11-03-2006, 09:11 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Which user? Until there's one user logged in, you don't know. Or maybe you know (eg: the "postfix" or "apache" user). Anyway:
- If you know, create a startup script, and launch this at startup: su - "$user" -c "/path/to/script"
- If you don't know, use the "autorun" ability of your users' window managers instead.

Yves.
 
Old 11-03-2006, 09:29 AM   #3
avijitp
Member
 
Registered: May 2005
Location: India
Distribution: FC11, Debian/Ubuntu, RHEL, Solaris, AIX, HP-UX
Posts: 161

Original Poster
Rep: Reputation: 32
theYinYeti,

I was thinking the same way by writing the script in the runlevel 3 rc3.d directory and call my script with the ownership of the user.

This script is a monitoring script and this needed to be started with the ownership of the user as the users dont have the sudo access to run the script at startup.

Thanks for confirming my thought.

If anybody has another idea on this issue, please share
 
  


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
RedHat: Getting my script to run after I reboot eur0dad Programming 13 07-26-2006 11:26 AM
Make a script run at reboot Braynid Linux - Newbie 10 06-26-2006 10:10 AM
how do I make sure that the user that is going to run the script is a root user??? nikold01 Linux - General 3 09-10-2004 07:54 AM
hard crash after 20 mins. every time on first boot reboot and it will run ok bejamin1 Mandriva 5 02-02-2004 12:42 PM
Run a script as a different user dtheorem Programming 5 11-05-2003 05:57 PM


All times are GMT -5. The time now is 01:47 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration