← Back to team overview

epoptes team mailing list archive

[Bug 1447321] [NEW] Add systemd support

 

Public bug reported:

Now that Debian/Ubuntu are switching to systemd as default, it's time to
Epoptes provide a better systemd support, which envolves:

 * Ship systemd service unit files for both epoptes[-server] and
epoptes-client.

 * Add "systemctl reboot" and "systemctl poweroff" fallbacks to
/usr/share/epoptes-client/endsession.

 * Gather more information from logind, specially about seats.

About service unit files, I've written the following examples for
openSUSE package:


epoptes.service:

[Unit]
Description=A twisted-based daemon that manages epoptes-client
After=syslog.target

[Service]
Type=forking
PIDFile=/run/epoptes.pid
ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.key ] || ! [ -s /etc/epoptes/server.crt ]; then openssl req -batch -x509 -nodes -newkey rsa:1024 -days 3652 -keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt; chmod 600 /etc/epoptes/server.key; fi"
ExecStart=/usr/bin/twistd --pidfile /var/run/epoptes.pid --logfile /var/log/epoptes.log epoptes

[Install]
WantedBy=multi-user.target


epoptes-client.service:

[Unit]
Description=Epoptes-client system daemon
Wants=network-online.target
After=network-online.target

[Service]
EnvironmentFile=-/etc/default/epoptes-client
ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.crt ]; then /usr/sbin/epoptes-client -c ${SERVER}; fi"
ExecStart=/usr/sbin/epoptes-client

[Install]
WantedBy=multi-user.target

NOTE: network-online.target may require that you explicitly enable the
*-wait-online.service that matches your current network management
mechanism (NetworkManager, systemd-networkd, etc.)

In the case one requires that epoptes-client service automatically
restarts if connection is lost, he can provide the following drop-in:

/etc/systemd/system/epoptes-client.service.d/auto-reconnect.conf:

[Service]
Restart=always

** Affects: epoptes
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Epoptes
Developers, which is subscribed to Epoptes.
https://bugs.launchpad.net/bugs/1447321

Title:
  Add systemd support

Status in Epoptes:
  New

Bug description:
  Now that Debian/Ubuntu are switching to systemd as default, it's time
  to Epoptes provide a better systemd support, which envolves:

   * Ship systemd service unit files for both epoptes[-server] and
  epoptes-client.

   * Add "systemctl reboot" and "systemctl poweroff" fallbacks to
  /usr/share/epoptes-client/endsession.

   * Gather more information from logind, specially about seats.

  About service unit files, I've written the following examples for
  openSUSE package:

  
  epoptes.service:

  [Unit]
  Description=A twisted-based daemon that manages epoptes-client
  After=syslog.target

  [Service]
  Type=forking
  PIDFile=/run/epoptes.pid
  ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.key ] || ! [ -s /etc/epoptes/server.crt ]; then openssl req -batch -x509 -nodes -newkey rsa:1024 -days 3652 -keyout /etc/epoptes/server.key -out /etc/epoptes/server.crt; chmod 600 /etc/epoptes/server.key; fi"
  ExecStart=/usr/bin/twistd --pidfile /var/run/epoptes.pid --logfile /var/log/epoptes.log epoptes

  [Install]
  WantedBy=multi-user.target


  
  epoptes-client.service:

  [Unit]
  Description=Epoptes-client system daemon
  Wants=network-online.target
  After=network-online.target

  [Service]
  EnvironmentFile=-/etc/default/epoptes-client
  ExecStartPre=/bin/sh -c "if ! [ -s /etc/epoptes/server.crt ]; then /usr/sbin/epoptes-client -c ${SERVER}; fi"
  ExecStart=/usr/sbin/epoptes-client

  [Install]
  WantedBy=multi-user.target

  NOTE: network-online.target may require that you explicitly enable the
  *-wait-online.service that matches your current network management
  mechanism (NetworkManager, systemd-networkd, etc.)

  In the case one requires that epoptes-client service automatically
  restarts if connection is lost, he can provide the following drop-in:

  /etc/systemd/system/epoptes-client.service.d/auto-reconnect.conf:

  [Service]
  Restart=always

To manage notifications about this bug go to:
https://bugs.launchpad.net/epoptes/+bug/1447321/+subscriptions


Follow ups

References