- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- "su" problem within a script
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
12-03-2001 06:11 PM
12-03-2001 06:11 PM
"su" problem within a script
the script gets started as user bsp without any issue. (the script is owned by root but some users are authorised to start it up.)
How do I add the above "su "syntax within the script itself so that the users can just type in "app.start" and the binaries gets started always as user "bsp" ?
The extract of the script is as below (Can someone let me know where to place "su bsp -c" option in the script in the fifth line here?)
Thanks
#!/bin/sh
BSE=/app/bse
BSE_TMP=/app/bse/tmp
echo 'Initialize Printer Daemon\n'
if [ -x ${BSE}/bin/pdaemon${REL} ];then
if [ -f ${BSE_TMP}/pd_lock ]; then
echo "Printer Daemon already running"
else
if ${BSE}/bin/pdaemon${REL} ;then
echo 'Printer Daemon Initialized\n'
else
echo 'Cannot Initialize Printer Daemon\n'
fi
fi
else
echo 'Cannot Initialize Printer Daemon\n'
fi
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2001 06:51 PM
12-03-2001 06:51 PM
Re: "su" problem within a script
However if you are root, you do not need to input a password.
if you want general users to run this, you can install a product called sudo. This will enable certain users to run certain commands as root. This is entirely configurable.
For HPUX I tend to go to the HPUX porting an archive centre.
http://hpux.connect.org.uk/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2001 07:48 PM
12-03-2001 07:48 PM
Re: "su" problem within a script
You have basically two options:
1) Install sudo to allow a non-root user to
execute this script.
2) Write a small setuid c program which changes user and then executes your script in a system() call.
By the way, you can simply forget about the Baan Printer Daemon and do all your printing as 'Direct' devices sending everything through the UNIX lp system; that works quite well.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2001 08:35 PM
12-03-2001 08:35 PM
Re: "su" problem within a script
I personally prefer restricted sam when it comes to tasks like this. Restricted sam sports a menu-like interface for users while allowing them to run setuid as root or another user. It is also highly configurable.
To add your script to restricted sam, execute
# sam -r
More information can be found in the man pages and HP-UX system administration guides.
Hope this helps. Regards.
Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2001 01:02 AM
12-04-2001 01:02 AM
Re: "su" problem within a script
heh, seems I answered this one on the Linux forum as well.
isn't
chown bsp <script>
chmod +s <script>
working?
E.