Post by @mcc@mastodon.social

Replying to @mcc@mastodon.social

@mcc I've honestly wondered for ages why "graceful" wasn't the default behavior, making "hard" the explicit option. 🤔

Replying to @mcc@mastodon.social
mr_daemon
@mr_daemon @untrusted.website

@mcc With the systemd unit, 'reload' instead of 'restart' should map to what 'graceful' does -- i.e. SIGUSR1.

Replying to @mcc@mastodon.social
cliffle
@cliffle @hachyderm.io

@mcc Apache's graceful shutdown is a SIGUSR1. You can set your systemd service unit to send SIGUSR1 for restart using

RestartKillSignal=USR1

from the look of it.

freedesktop.org/software/syste= (the "kill" options are, uh, "subclassed" into service units, for lack of a better word)

httpd.apache.org/docs/2.4/stop

Replying to @mcc@mastodon.social
mcc
@mcc @mastodon.social

$ sudo systemctl reload apache2
apache2.service is not active, cannot reload

LENNART, I THINK YOU'LL FIND THAT'S IN FACT THE EASIEST TIME TO RELOAD?!?

Replying to @mcc@mastodon.social
Amber :neodog_box:
@puppygirlhornypost2 @transfem.social

@mcc@mastodon.social doesn't reload keep apache2 running anyway tho? like if you wanted it to exit gracefully well...

Amber :neodog_box:
@puppygirlhornypost2 @transfem.social

@mcc@mastodon.social nvm i missed the part about it restarting it after. ig systemd reload would be your best bet then

mcc
@mcc @mastodon.social

@puppygirlhornypost2 based on the service file, i think you are correct

❤ 1
Replying to @mcc@mastodon.social
mcc
@mcc @mastodon.social
Public en edited

Okay so get this. I looked inside the apache2.service file.

ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl graceful-stop
ExecReload=/usr/sbin/apachectl graceful

So switching to systemd doesn't take away the apachectl behaviors I want at all! Because I haven't stopped using apachectl at all!! All that's changed is I no longer get to call apachectl myself!! Lennart has to do it for me!!!

Replying to @mcc@mastodon.social
Karel P Kerezman
@greyduck @wellduck.me

@mcc Mmmm, tasty tasty obfuscation layers. Yum.

Replying to @mcc@mastodon.social
Irenes (many)
@ireneista @irenes.space

@mcc yes. on NetBSD we've been noticing more and more ways in which systemd's abstractions had been getting in our way, and we'd been taking it as a good thing (reproducibility!), but, uh............

Replying to @mcc@mastodon.social
JdeBP
@JdeBP @tty0.social
Replying to @mcc@mastodon.social
Eashwar
@e_nomem @hachyderm.io

@mcc `systemctl try-reload-or-restart <name>.service` will reload the service, if it supports reload, or else restart it, but only if it's already active.

`systemctl reload-or-restart` (without the `try-` prefix) is the same, but will activate the service if it is inactive as well.

Replying to @e_nomem@hachyderm.io
mcc
@mcc @mastodon.social

@e_nomem Thank you very much. I was looking at a document I would have expected to explain this, but maybe I was skimming.

Replying to @mcc@mastodon.social
Eashwar
@e_nomem @hachyderm.io

@mcc Honestly, I only discovered that these commands existed by reading the manpage of systemctl. I've never seen them referenced anywhere else.

I pretty much exclusively use `systemctl try-reload-or-restart` in shell scripts as the safe default to restart a service.

Replying to @mcc@mastodon.social
MaddieM4
@MaddieM4 @raphus.social

@mcc I need to learn his middle name so I can yell his full government name like a pissed off mom. LENNART ALBERT POETTERING, WE DO NOT HINGE EVERYTHING ON SOCKET ACTIVATION IN THIS HOUSE. you see the vision. that's probably not his real name, except maybe by coincidence. but it would be like that.

Replying to @mcc@mastodon.social
linear cannon
@linear @nya.social
@mcc@mastodon.social i don't understand, doesn't the "reload" target just tell the running apache2 to reload its configuration? what would you expect it to do if apache isn't running?
Replying to @linear@nya.social
mcc
@mcc @mastodon.social

@linear it appears there is a reload-or-restart which is what i actually wanted.

Replying to @mcc@mastodon.social
mcc
@mcc @mastodon.social

@linear (what i wanted is "get the system running with the new configuration, with the minimum disruption to service")

Replying to @mcc@mastodon.social
Kobold
@kobold @orthographieanarchist.de

@mcc I sure know why I am blocked by systemd's lead dev here on Mastodon, having asked the "why" question once too often.

There is no logic, systemd is mostly bad and I am seriously annoyed my laptop's WiFi is not supported by @irgendwienet

Benjamin Schröter
@irgendwienet @chaos.social

@kobold @mcc i got nothing to do with that.

mcc
@mcc @mastodon.social

@irgendwienet @kobold I'm confused

Replying to @mcc@mastodon.social

@mcc@mastodon.social As you can see by the helpful responses to this last question, one aspect of joining the Leonard Poettering survivors support group is that there are a lot of us and we've likely already stubbed our toe in that same spot several times.

And now you can decide to branch out and explore other OSen in your own time and not be frustrated by this particular problem :)