2

I am running into a problem when trying to start a detached screen through a Solaris 11 service.

This service controls nginx. When I reboot the system, the screen doesn't start, but if I issue svcadm disable nginx then svcadm enable nginx manually, it does. The rest of the init script functions correctly on a reboot (the nginx daemon starts, etc).

The part of the service that triggers the screen looks like this:

case "$1" in
    start)            
        echo "Starting Nginx Logger: \c"
        /usr/bin/screen -S nginxLogger -d -m /opt/php-5.3.10/bin/php $loggingProg
        LogRetVal=$?
        [ $LogRetVal -eq 0 ] & echo "ok" || echo "failed"
        ....

The log (/var/svc/log/network-nginx:default.log) shows that $LogRetVal is returning 0, and $loggingProg is just pointing to a PHP script.

If it matters, when I manually restart the service, I'm logged in as root. I'm unsure how to check if it's a permission issue (I'm new to Solaris, I've recently switched from CentOS/RHEL).

Sephreph
  • 21
  • 1

1 Answers1

0

The most probably after restart it starts too early... may be sooner than networking is up. Put proper dependencies to service description XML.

Btw svcs -xv prints out services in maintenance state and its log file where you can find potential error.

And for what reason screen? It seems to be some misunderstandings of SMF.

nudzo
  • 648
  • 1
  • 6
  • 8