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
        echo "Starting Nginx Logger: \c"
        /usr/bin/screen -S nginxLogger -d -m /opt/php-5.3.10/bin/php $loggingProg
        [ $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).


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.