[opensuse] running a script as a user at bootup?
All, I'm familiar with /etc/rc.d and friends, but those all run as root. I have a small script I want to run every bootup, but as a specific user. Is there an official way to do that? Thanks Greg -- Greg Freemyer Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer First 99 Days Litigation White Paper - http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 15 February 2009 18:19:21 Greg Freemyer wrote:
All,
I'm familiar with /etc/rc.d and friends, but those all run as root.
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
Add it to that user's crontab, and set the time to @reboot Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, Feb 15, 2009 at 12:27 PM, Anders Johansson
On Sunday 15 February 2009 18:19:21 Greg Freemyer wrote:
All,
I'm familiar with /etc/rc.d and friends, but those all run as root.
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
Add it to that user's crontab, and set the time to @reboot
Anders Thanks Anders,
That worked perfectly once I realized @reboot replace all 5 time fields. ie. * * * * * command becomes @reboot command Greg -- Greg Freemyer Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer First 99 Days Litigation White Paper - http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anders Johansson wrote:
On Sunday 15 February 2009 18:19:21 Greg Freemyer wrote:
All,
I'm familiar with /etc/rc.d and friends, but those all run as root.
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
Add it to that user's crontab, and set the time to @reboot
Anders
Where is the user's crontab? -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 15 February 2009 18:52:49 James Knott wrote:
Where is the user's crontab?
it's stored under /var/spool/cron/tabs/, but you shouldn't edit it directly. Rather, you should run "crontab -e" as that user (or crontab -u <username> -e if you want to do it as root or some other user) Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday February 15 2009, Anders Johansson wrote:
On Sunday 15 February 2009 18:19:21 Greg Freemyer wrote:
...
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
Add it to that user's crontab, and set the time to @reboot
Thanks for pointing that out. Even though I just recently perused the "crontab" (1 and 5) man pages, I didn't read down far enough on crontab(5) to notice the keywords. So for others, the available invocation time keywords in crontab files are: @reboot : Run once, at startup. @yearly : Run once a year, ie. "0 0 1 1 *". @annually : Run once a year, ie. "0 0 1 1 *". @monthly : Run once a month, ie. "0 0 1 * *". @weekly : Run once a week, ie. "0 0 * * 0". @daily : Run once a day, ie. "0 0 * * *". @hourly : Run once an hour, ie. "0 * * * *".
Anders
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Greg Freemyer wrote:
All,
I'm familiar with /etc/rc.d and friends, but those all run as root.
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
I believe su will do that. You can use it to run a command as a different user. You'd use something like: su - username -c path/command You can place that command in /etc/init.d/after.boot. -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Greg Freemyer a écrit :
All,
I'm familiar with /etc/rc.d and friends, but those all run as root.
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
Thanks Greg
Hi, Set your script in /home/"the specific user"/.kde/Autostart/ it'll be executed as boot for this user only. Michel. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Catimimi wrote:
Greg Freemyer a écrit :
All,
I'm familiar with /etc/rc.d and friends, but those all run as root.
I have a small script I want to run every bootup, but as a specific user.
Is there an official way to do that?
Thanks Greg
Hi,
Set your script in /home/"the specific user"/.kde/Autostart/
it'll be executed as boot for this user only.
Michel.
Does that work at computer boot up or only when the user logs in? -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday February 15 2009, James Knott wrote:
...
Does that work at computer boot up or only when the user logs in?
The latter, when the user logs in. Every time the user logs in. To KDE only.
-- Use OpenOffice.org http://www.openoffice.org
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Anders Johansson
-
Catimimi
-
Greg Freemyer
-
James Knott
-
Randall R Schulz