0

I've got a little Atom box that I'm running Xubuntu (18.04.3 LTS Ubuntu with Xfce) on and I've got lighttpd up and going by adjusting the port number in the conf file (to avoid a collision with Apache on port 80).

I can start lighttpd by using 'service lighttpd start' but when I do 'service --status-all', lighttpd does not show up (as either a + or -). I can ps and see the process and I can netstat and see my port is up (and I can browse to that port and see my index page).

Shouldn't lighttpd show up as a service's --status-all if it can be started with a service command?

Is there some setting or place that --status-all pulls its information about what is a configured service? (a text table somewhere or something)?

I've got a configuration that works, but now I'd like to: a) Get it to behave like a service (including showing up in status queries) b) Get it to autostart with the machine

So what am I missing to make those things happen?

1 Answer 1

0

On Ubuntu (and likely other distributions using systemd) the service binary is a helper that starts an System V init script (from /etc/init.d) or a systemd unit. According to the man page for the service binary:

The existence of a systemd unit of the same name as a script in /etc/init.d will cause the unit to take precedence over the init.d script.

When installing lighttpd it includes both the System V init script and a systemd unit:

ubuntu@primary:~$ dpkg -S /lib/systemd/system/lighttpd.service
lighttpd: /lib/systemd/system/lighttpd.service

ubuntu@primary:~$ dpkg -S /etc/init.d/lighttpd 
lighttpd: /etc/init.d/lighttpd

What is happening in your case is you actually started the systemd unit. The service binary doesn't show the status for systemd units.

You can see it listed in the status or list-units for subcommand for systemctl using:

sudo systemctl list-units

You can also get the individual unit status using:

sudo systemctl status lighttpd
1
  • Okay, I had seen there were two methods (well, there's a third too at least) of starting up services. I think? implicit in what you've said here is that to see the services running, I may need to look at two separate lists? Now I have to make sure that lighttpd is running at startup. I'll review the systemctl notes. Thanks for the help. Feb 13, 2020 at 5:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .