Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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