Start a screen through svcadm with Solaris 11

Posted by Sephreph on Server Fault See other posts from Server Fault or by Sephreph
Published on 2012-07-02T01:11:36Z Indexed on 2012/07/02 3:17 UTC
Read the original article Hit count: 430

Filed under:
|
|

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).

© Server Fault or respective owner

Related posts about solaris

Related posts about screen