4

What is the difference between the following

sudo /etc/init.d/lighttpd restart

and

/etc/init.d/lighttpd force-reload

?

Aliaksandr Belik
  • 259
  • 6
  • 17
aneuryzm
  • 1,714
  • 5
  • 26
  • 41

2 Answers2

4

On my platform (ubutnu), I found that they are the same. Just looked the file and found:

case "$1" in

.... processing other options

;;
restart|force-reload)
  processing restart and force-reload options

For other services, it might be different.

Khaled
  • 36,533
  • 8
  • 72
  • 99
4

This can also be achieved using Signals. See the Blogpost about Lighty's Angel for an overview of the Signals supported by lighttpd.

In short

  • SIGHUP leads to a graceful restart (config reloads)
  • SIGINT is graceful shutdown as now
  • all unhandled signals lead to a restart of the lighttpd process

The debian Policy Manual also explains the different parameters:

  • start
    start the service,

  • stop
    stop the service,

  • restart
    stop and restart the service if it's already running, otherwise start the service

  • reload
    cause the configuration of the service to be reloaded without actually stopping and restarting the service,

  • force-reload
    cause the configuration to be reloaded if the service supports this, otherwise restart the service.

pacey
  • 3,833
  • 1
  • 16
  • 31