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

6,566

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.

Share:
6,566

Related videos on Youtube

jringoot
Author by

jringoot

Linux sysadmin since 2009. I used to be a laboratory worker and a CAM worker (1996-1998). Then I became a computer support helpdesk/technician mainly focused on Microsoft products. My first Linux install attempt is from 1998, Debian over a modemline, didn't do much with it, it was very inconvenient, since I had no second computer and no manual, and the install was CLI only. I installed Windows NT. In 1999 I purchased a CD with redhat 6.1, installed it, used it a while as desktop OS, dual boot with windows. In 2000 I tried Suse 6.4: I bought the box with the manual package. Next I experimented further with downloaded redhat 7 and 8, then redhat became RHEL, no longer free, and I switched back to Debian. I tried several distros (mandrake, fedora, bestlinux, etc...), in 2005 I installed my first Ubuntu. In 2006 I was taking eveningclass to study Linux and to become a bachelor of informatics. (The rest I add later on)

Updated on September 18, 2022

Comments

  • jringoot
    jringoot over 1 year

    Why is sssd an unrecognized service, even though it is installed and can be restarted? BTW: This concerns Ubuntu 14.04.1 LTS, it was not like that in 12.04 I will show what I mean below, I think it is a bug but I am interested in an explanation and/or workaround.

    root@tauriel:~/scripts# service sssd
    **sssd: unrecognized service**
    root@tauriel:~/scripts# service sssd status
    sssd start/running, process 22454
    root@tauriel:~/scripts# service sssd restart
    sssd stop/waiting
    sssd start/running, process 22485
    root@tauriel:~/scripts# service sssd status
    sssd start/running, process 22485
    root@tauriel:~/scripts# service sssd
    **sssd: unrecognized service**
    root@tauriel:~/scripts# 
    

    BTW: sssd is apparently a new tag, it would be nice if it was added.

  • jringoot
    jringoot over 9 years
    Thank you for the answer muru. I also noticed that it is not listed when doing a "service --status-all" What is the best current method to see the status of all/any deamons, when they are started and how can you control it? (update-rc.d doesn't work since the /etc/init.d/sssd does not exist)
  • jringoot
    jringoot almost 7 years
    I just noticed that after an apt-update && apt-upgrade (Ubuntu 14.04) sssd didn't want to start automatically anymore. Following your instructions, I looked inside /etc/init/sssd.conf and found a difference with another host: "start on (filesystem and net-device-up and starting autofs)" ================= I changed it into ================= "start on (filesystem and net-device-up)" ================= And now sssd starts up on boot again. I know it is kluge, but an interesting workaround I think.