- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Creating a daemon using a shell 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
Discussions
Discussions
Discussions
Forums
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
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
тАО07-18-2003 06:57 AM
тАО07-18-2003 06:57 AM
case $1 in
start)
echo start
/usr/local/adm/testscript1 /usr/local/adm/pid.log 2>&1 &
;;
stop)
echo stop
touch /usr/local/adm/killdaemon
;;
esac
This calls my daemon in the background so the boot can continue. My testscript1 reads:-
export PATH=$PATH:/usr/sbin:/usr/bin
echo $PATH
while true
do
echo "`date` - This is a test" >> /usr/local/adm/test.log 2>&1
sleep 10
done
When I run this from the command line it works fine. HOWEVER when it is executed via a reboot only one loop of the while loop takes place and then it just disappears. It doesn't run in the background. What am I doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 07:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 07:58 AM
тАО07-18-2003 07:58 AM
Re: Creating a daemon using a shell script
See the attached daemon which is equivalent to your shell attempt. It took me longer to type this responce than it did to rip apart and paste together one of my existing daemons.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 08:57 AM
тАО07-18-2003 08:57 AM
Re: Creating a daemon using a shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 09:06 AM
тАО07-18-2003 09:06 AM
Re: Creating a daemon using a shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 09:15 AM
тАО07-18-2003 09:15 AM
Re: Creating a daemon using a shell script
Be very cautious though, as different OS's ship with different versions of Perl.
Sincerely,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 09:20 AM
тАО07-18-2003 09:20 AM
Re: Creating a daemon using a shell script
lets say in HP-UX perl is at /usr/local/bin/perl
and in AIX its at /usr/local/perl
You can change the first line of your program to reflect that:
#!/usr/local/bin/perl
to
#!/usr/local/perl
Lets say you want the HP-UX script to work on all platforms unmodified.
Then on the AIX box, do this:
ln -s /usr/local/perl /usr/local/bin/perl
I use this kind of soft linking to avoid having to change perl scripts that run on many different OS's for my websites.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2003 09:45 AM
тАО07-18-2003 09:45 AM