* Brian Gupta <brian.gupta at gmail.com> [2007-04-25 13:07]:
> Are you trying to register a new service? If so, my understanding is
> that svd.configd needs to have been launched at system startup.
> 
> So, while checking for svcadm will tell you if the system was built
> with sfw, it will not let you know if you can register a new service.
> (Feel free to correct my understanding, as I am still absorbing all
> the changes in S10+).
> 
> psck=svc.configd;echo -e "$psck is \c";pgrep $psck >/dev/null 2>&1; if
> [ $? -eq 0 ]; then echo running; else echo not running 1; fi
> 
> If you need to actually start or stop the svc you need to replace also
> check for svc.startd

  If you want to compose a live check without navigating /proc, just
  source /lib/svc/share/smf_include.sh, and invoke the smf_present shell
  function:

  smf_present () {
          [ -r /etc/svc/volatile/repository_door ] && \
              [ ! -f /etc/svc/volatile/repository_door ]
  }

  or implement similar using whatever language feature allows access to
  stat(2) inquiries.

  - Stephen

-- 
sch at sun.com  http://blogs.sun.com/sch/

Reply via email to