- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sbin/init.d
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2002 07:10 AM
03-26-2002 07:10 AM
how can I start a process by the sbin/init.d with an other user than root ?
thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2002 07:14 AM
03-26-2002 07:14 AM
Re: sbin/init.d
That would not be advisable (if at all posible). However, it is "accepted behavior" :-) to do an "su -" inside the script. For example the standard oracle database startup script would do something like :
...
# Execute the commands to start your subsystem
echo "Starting databases ..."
su - oracle -c dbstart
...
Most softwares work this way ...
Hope this helps,
Tom Geudens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2002 07:15 AM
03-26-2002 07:15 AM
Re: sbin/init.d
su -c $USER /foo/foo.sh > /foo/foo.out
Good Luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2002 07:17 AM
03-26-2002 07:17 AM
Re: sbin/init.d
The permissions for the directory /sbin/init.d has been set to meet the system security. If you want another user to stop/start some process, you can copy that specific script to the user home directory ( eg: 'dbora' file in the Oracle $HOME directory).
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2002 07:20 AM
03-26-2002 07:20 AM
SolutionYour question is not clear. If the question is can you manually run an sbin/init.d script as a regular user then the answer is that depends entirely upon the permissions of the underlying commands. If you want to run an /sbin/init.d/ automatically as another user then you need to use the su command. e.g. su oracle -c "/u01/oracle/bin/orastart.sh". DO NOT USE su - -c "/u01/ ... " because the "-" option will run oracle's .profile. I know you think that is a good thing but the problem is that many of the commands assume an interactive user (tset, tabs) and under rc there will not be one. The correct way to do this is to create a file (e.g. /usr/local/bin/oraenv.sh) and do all the environment vars and PATHS stuff there. You then source that file as both part of your startup file AND as user oracle's .profile. Do it like this:
. /usr/local/bin/oraenv.sh (do not put an exit statement in the sourced file). The '.' causes the shell to include this file as part of the current shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2002 07:20 AM
03-26-2002 07:20 AM
Re: sbin/init.d
The permissions dictate who can run the command. Not the permissions on the file in init.d, but the ones on the script itself (for example, sendmail is in /usr/sbin). You can change these to give any user access to run it, but I'd be careful. Normally, you don't want users to be able to start and stop these processes.
Mark