]> code.ossystems Code Review - openembedded-core.git/commitdiff
rpcbind: avoid entering failed status after stopping daemon
authorChen Qi <Qi.Chen@windriver.com>
Wed, 3 Sep 2014 07:09:11 +0000 (15:09 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Sep 2014 09:24:21 +0000 (10:24 +0100)
Exiting with '2' is actually expected with rpcbind, because it catches
SIGTERM and exits with '2' explicitly.

The related code is as follows.

(void) signal(SIGTERM, terminate);

/*
 * Catch the signal and die
 */
static void
terminate(int dummy /*__unused*/)
{
        close(rpcbindlockfd);
        unlink(_PATH_RPCBINDSOCK);
        unlink(RPCBINDDLOCK);
        syslog(LOG_ERR,
                "rpcbind terminating on signal. Restart with \"rpcbind -w\"");
        write_warmstart(); /* Dump yourself */
        exit(2);
}

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/rpcbind/rpcbind/rpcbind.service

index 4de28d4ae18316295f3187b08192d10a96ba8cf6..33ee268441d98efe67de37ec926941b6967c1664 100644 (file)
@@ -9,6 +9,7 @@ Type=forking
 EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
 ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS
 Restart=always
+SuccessExitStatus=2
 
 [Install]
 WantedBy=multi-user.target