Skip to content

netlog: Remove daemon features #300

Merged
merged 1 commit into from
Jan 20, 2023
Merged

netlog: Remove daemon features #300

merged 1 commit into from
Jan 20, 2023

Conversation

donald
Copy link
Collaborator

@donald donald commented Jan 20, 2023

We now run the netlog daemon as a systemd service. The features to
demonize, redirect logging, restart and kill previous daemons are all
not needed. Additionally, the restart is buggy, because
Donald::Tools::kill_previous_server doesn't kill the parent - assuming
this is an rc.d script. However, in --foregound mode, the previous
daemon is in fact the parent.

  • Remove unused features and leave job control and logging to systemd.
  • Log into journal instead of into syslog.
  • Remove "Description=" from the unit, because its easier to identify
    things, when the name used in messages is the same as the unit name
    and the unit file name.

Fixes #299

I love more "-" than "+" :-)
netlog/netlog | 43 +------------------------------------------
netlog/netlog.service | 5 +----

We now run the netlog daemon as a systemd service. The features to
demonize, redirect logging, restart and kill previous daemons are all
not needed. Additionally, the restart is buggy, because
Donald::Tools::kill_previous_server doesn't kill the parent - assuming
this is an rc.d script. However, in `--foregound` mode, the previous
daemon is in fact the parent.

- Remove unused features and leave job control and logging to systemd.
- Log into journal instead of into syslog.
- Remove "Description=" from the unit, because its easier to identify
  things, when the name used in messages is the same as the unit name
  and the unit file name.
@donald donald merged commit 8ed0e29 into master Jan 20, 2023
Copy link
Contributor

@pmenzel pmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/demonize/daemonize/

Requires=network.target
After=network.target

[Service]
ExecStart=/usr/sbin/netlog --daemon --foreground --kill --syslog /var/log/messages /var/log/mail.log
ExecStart=/usr/sbin/netlog --daemon /var/log/messages /var/log/mail.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t the --daemon not very systemd idiomatic(?), that means, it prefers programs that do not daemonize?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Year right. There are two operating modes: What would be better?

netlog test files...
netlog run files...

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "watch" instead of run, because it watches the named files. Or "service", because it runs forever waiting for external events (data appended top these files). "service" seems to be better when applied to clusterd, which also has "--daemon" at the moment. clusterd loops forever waiting for external events over the network. idk.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like watch, but don’t have a strong opinion.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

netlog auto-restart after config changes leaves two instances running
2 participants