Why is sssd an unrecognized service, even though it is installed and can be restarted?

When you run service, if there's a sysv init script, it will call that script (or call Upstart, if it's an Upstart job):

$ service ssh
 * Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart|status}
$ service gdm
/etc/init.d/gdm: 79: /etc/init.d/gdm: Syntax error: "fi" unexpected (expecting "}")

Naturally if you don't pass a command (restart, status, etc.), only these scripts will be able to respond. If the init file for a service is Upstart-only, this will fail:

$ service tty1
tty1: unrecognized service

SSSD only offers an Upstart init script, as you can see from the list of files in sssd-common.


This behaviour is not exactly well documented in the manpage. However, if you examine the service command, which is a shell script:

118 if [ -r "/etc/init/${SERVICE}.conf" ] && which initctl >/dev/null \
119    && initctl version | grep -q upstart
120 then
121    # Upstart configuration exists for this job and we're running on upstart
122    case "${ACTION}" in  

The actions in this case consists of exec calls of initctl (via its symlinked versions - start, stop, etc.). Since the ACTION variable is empty and doesn't match any case, it falls through to:

138 
139 # Otherwise, use the traditional sysvinit
140 if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
141    exec env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" ${ACTION} ${OPTIONS}
142 else
143    echo "${SERVICE}: unrecognized service" >&2
144    exit 1
145 fi

Here you can see why it produces that error.