GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- "sudo" Functionality
Operating System - HP-UX
1847206
Members
3266
Online
110263
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
- 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
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
02-19-2003 05:49 AM
02-19-2003 05:49 AM
"sudo" Functionality
When calling a script to be executed as the owner of the script using sudo, .cshrc found under the users home page is not sourced when setting the first line to be #!/bin/csh. The current workaround is to explicitly source .cshrc in the calling script.
Are we missing some sort of sudo setting or is the user account is not setup correctly?
Are we missing some sort of sudo setting or is the user account is not setup correctly?
Change is the only constanT
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2003 06:22 AM
02-19-2003 06:22 AM
Re: "sudo" Functionality
try sudo su - user -c command
This will read the users probile
-Tomek
This will read the users probile
-Tomek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2003 06:31 AM
02-19-2003 06:31 AM
Re: "sudo" Functionality
Setting the shell in the first line of a script does not cause any behavior other than causing the script to run via that particular shell.
The best practice is to explicitly set whatever environment variable you need within a script.
If you ever want to run this script via cron or at then sourcing a .cshrc or .profile will not necessarily work either since the script is not being run from a terminal. If you do source a .cshrc then it is likely you'd get the infamous "stty: not a typewriter" message since it is assuming that by default anything sourcing the .cshrc or .profile is at a terminal.
The best practice is to explicitly set whatever environment variable you need within a script.
If you ever want to run this script via cron or at then sourcing a .cshrc or .profile will not necessarily work either since the script is not being run from a terminal. If you do source a .cshrc then it is likely you'd get the infamous "stty: not a typewriter" message since it is assuming that by default anything sourcing the .cshrc or .profile is at a terminal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2003 07:39 AM
02-19-2003 07:39 AM
Re: "sudo" Functionality
I do see what you are getting at. There are two servers though, a production one and a development one. Our UNIX outsource partner, may they profit for ever, can not put their hands on the issue as the setup on the development server is working just fine. When we moved into production the START and STOP daemon scripts stopped working in production.
The issue is we have an Oracle repository owned by owner_oracle and an application tier running on UNIX owned by owner_app. We have an automated script that stop the app tier before the database is shutdown and starts it after the database opens.
So the question is why is it working in development while in production its not.
Through testing and trial and error I have developed a work-around that currently works from a terminal but not have tested it yet from cron. The workaround is to directly source .cshrc from the calling scripts.
The issue is we have an Oracle repository owned by owner_oracle and an application tier running on UNIX owned by owner_app. We have an automated script that stop the app tier before the database is shutdown and starts it after the database opens.
So the question is why is it working in development while in production its not.
Through testing and trial and error I have developed a work-around that currently works from a terminal but not have tested it yet from cron. The workaround is to directly source .cshrc from the calling scripts.
Change is the only constanT
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