start-up

start-up

Post by root » Mon, 25 Sep 2000 04:00:00



    I'm starting a process on a Solaris 7 from /etc/rc2.d
I don't use a shell script, just a compiled binary:
/etc/rc2.d/S88blah

#include <unistd.h>
main()
{ execl("/usr/lib/blah","blah",(char *)0); }
It executes all fine when I do it by hand and puts the process in the
background.
However, it doesn't execute at boot-time.
S88 should be late enough for everything to be available, I put it
straight after S88utmpd which executes from /usr/lib too and utmpd
starts alright.
Any clue would be much appreciated.
Thanks.

 
 
 

start-up

Post by Ryan T. Tennan » Tue, 26 Sep 2000 04:00:00


Hello.  All files that begin with "S" in /etc/rc2.d are run with the
following command (re: /sbin/rc2 from SunOS 5.6);

for f in /etc/rc2.d/S*
   {
   if [ -s ${f} ]
       then
       case ${f} in
           *.sh)   .        ${f} ;;        # source it
           *)      /sbin/sh ${f} start ;;  # sub shell
       esac
   fi
   }

Note how it will attempt to run your program as;

/sbin/sh S88blah start

This means it is going to attempt to run your process as a shell script
regardless of what it is.  In general, it is good practice to have
start/stop scripts for your program in the rc directories.

case "$1" in
    start) blah ;;
    stop)  pkill blah ;;
esac

pkill is introduced in SunOS 5.7. If you are using 5.6 like me, simply
write something to find your process id.  For example;

pid=`ps -aef  | awk '/[b]lah/ {print $2}'`
kill $pid

Make sure whatever you use to find the pid matches EXACTLY what you are
looking for.  kill does so indiscriminately.
Take care.

Ryan Tennant
DevUnix.org


>     I'm starting a process on a Solaris 7 from /etc/rc2.d
> I don't use a shell script, just a compiled binary:
> /etc/rc2.d/S88blah

> #include <unistd.h>
> main()
> { execl("/usr/lib/blah","blah",(char *)0); }
> It executes all fine when I do it by hand and puts the process in the
> background.
> However, it doesn't execute at boot-time.
> S88 should be late enough for everything to be available, I put it
> straight after S88utmpd which executes from /usr/lib too and utmpd
> starts alright.
> Any clue would be much appreciated.
> Thanks.


 
 
 

1. Start-ups

We are the leader in recruitment for Networking Start-ups in the
Optical, DSL and Wireless Data spaces.

The Networkmine is looking for:
 - V.P Routing Develpoment at a super hot optical manufacturer in the
MAN space

- Asic and software developers (Routing protocols OSPF, BGP, PPP)
- Routing engineers with pre/post sales experience
- Test engineers
- Network protcol SQA testers.  
- Distributed Computing (CORBA) software developers.  
- Optical networking/Sonet architect/guru.  
- IP network operators across the country

We are working with the leader in the wireless Data world providing a
fiberless optical network with 10 meg to the last mile!

Our clients are listed in the top 50 companies to watch (Red Herring)
and offer a comprehensive stock option plan combined with exceptional
salaries.

We give cash $2000 U.S referrals for candidates that are placed with
our clients. Confidentiality guaranteed.

Respond to

or call directly
Glen Rostie
705.522.9256

2. Apache mod_rewrite for URL Web Forwarding

3. Delayed systerm logger at start ups

4. SOLVED: Thinkpad A30 Suspend Hibernate dual-boot APM Problems

5. Shape Ups,Men's Shape Ups,Men's Skechers Shape Ups - new styles!

6. [RFC][Call for Testers] Change of [const] char definitions from Kernel Janitor TODO List (Against 2.5.40)

7. Can't wait for UPS/FedEx, need help getting started with 5.2.

8. Solaris 2.7 and SunPC 4.2

9. diff -rcN ups-2.45.2/Makefile ups/Makefile

10. APC USB ups, Back-UPS ES series, 2.5.68

11. UPS - software driver for the APC Smart UPS - 600 (Please HELP )

12. UPS Woes (APC Back-UPS Pro)

13. APC Back-UPS 400, updated howto for UPS?