Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Running Startup Script As Different User
lucidthoughts
post May 10 2004, 11:15 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 5
Joined: 16-April 04
Member No.: 2,786



Hello all,
I have a script (specifically one that just runs a single program to start a license server).
The catch is that it has to be run by the user 'matlab'.

How do I go about making it so that when the computer boots up this is automaticallly done as opposed to having to su to user matlab and then running it manually?

Thanks!
Go to the top of the page
 
+Quote Post
hughesjr
post May 10 2004, 11:14 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



in the startup script, you would use the command:

su - matlab -c script_to_start

Note: The users environment might not load, so in the script_to_start, be sure to source the users .bashrc and/or .bash_profile file if required at the beginning of the script.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
petterg
post May 11 2004, 03:24 AM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 12
Joined: 5-May 04
Member No.: 2,890



my experience is that su may not run from scripts.
If thats the case for you - try using sudo (www.sudo.ws)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 14th December 2017 - 01:15 AM