GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script in rc2.d started by a no-root user
Operating System - HP-UX
1848539
Members
3737
Online
104033
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
11-05-2007 04:17 AM
11-05-2007 04:17 AM
script in rc2.d started by a no-root user
Hello everybody,
Can I do a script in the rc2.d folder to be run by a no-root user?
I need to start a process owned by a user different than root in the boot of my HP-UX server. Is it possible? I have seen that using the -c option of su command may help, but I find that the command following -c is not run in the shell opened by su (with "-" option), but after it is exited.
Thank you for your answers.
Can I do a script in the rc2.d folder to be run by a no-root user?
I need to start a process owned by a user different than root in the boot of my HP-UX server. Is it possible? I have seen that using the -c option of su command may help, but I find that the command following -c is not run in the shell opened by su (with "-" option), but after it is exited.
Thank you for your answers.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2007 04:24 AM
11-05-2007 04:24 AM
Re: script in rc2.d started by a no-root user
Hi,
The su works for us, only you have to use the -c after the user name.
e.g.
/bin/su -c
Mike.
The su works for us, only you have to use the -c after the user name.
e.g.
/bin/su
Mike.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2007 04:33 AM
11-05-2007 04:33 AM
Re: script in rc2.d started by a no-root user
We also use this all the time for just about any application.
/sbin/init.d/myapp
su - user -c "start_script"
(remember to set the CONTROL_VAR to something also i.e MYAPP )
Link startup control files.
ln -s /sbin/init.d/init.d/myapp /sbin/rc2.d/S900myapp
ln -s /sbin/init.d/myapp /sbin/rc1.d/K900myapp
edit /etc/rc.config.d/myapp
MYAPP=1
/sbin/init.d/myapp
su - user -c "start_script"
(remember to set the CONTROL_VAR to something also i.e MYAPP )
Link startup control files.
ln -s /sbin/init.d/init.d/myapp /sbin/rc2.d/S900myapp
ln -s /sbin/init.d/myapp /sbin/rc1.d/K900myapp
edit /etc/rc.config.d/myapp
MYAPP=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2007 03:59 PM
11-05-2007 03:59 PM
Re: script in rc2.d started by a no-root user
>but I find that the command following -c is not run in the shell opened by su -, but after it is exited.
Why do you think it is "after it is exited"?
When you use "su -", you create a login shell and execute profile and .profile then your command that follows "-c".
Why do you think it is "after it is exited"?
When you use "su -", you create a login shell and execute profile and .profile then your command that follows "-c".
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP