greenlight icon indicating copy to clipboard operation
greenlight copied to clipboard

systemd service file

Open debuglevel opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. If I have to restart greenlight (installed with bbb-install.sh), I have to do something like cd /root/greenlight && docker-compose down && docker-compose up -d - which somehow feels wrong. greenlight is, like all the other bbb-* services, something I'd like to see managed by systemctl.

Describe the solution you'd like There should be a Service/Unit file for systemd. systemctl restart greenlight should work.

Describe alternatives you've considered Well, it works for now. But it feels wrong.

Additional context I created a /etc/systemd/system/greenlight.service which seems to work:

[Unit]
Description=BBB Greenlight
After=docker.service

[Service]
User=root
WorkingDirectory=/_deployment/greenlight/
ExecStart=/usr/local/bin/docker-compose up -d --remove-orphans
ExecStop=/usr/local/bin/docker-compose down
RemainAfterExit=true
Type=oneshot

[Install]
WantedBy=multi-user.target

Althought it does not integrate as nice as other services with systemd (e.g. it has no idea whether it was stopped manually because it is a Type=oneshot).

Also, this might be a bbb-install issue instead? Not sure about this issue, tbh.

debuglevel avatar Jun 17 '22 15:06 debuglevel

I changed my service file to not use -d (daemonize). This way the forked process does not return and systemd actually can know something about the state of the process. Most systemd+compose howtos out there use -d, which does not make much sense in my opinion.

[Unit]
Description=BBB Greenlight
After=docker.service
Requires=docker.service

[Service]
User=root
WorkingDirectory=/_deployment/greenlight/
ExecStartPre=-/usr/local/bin/docker-compose down
ExecStart=/usr/local/bin/docker-compose up --remove-orphans
ExecStop=/usr/local/bin/docker-compose stop

[Install]
WantedBy=multi-user.target

debuglevel avatar Jun 17 '22 15:06 debuglevel

Please note: Greenlight v3 has been released. With this new version, many of the issues and bugs that were present in v2 have been resolved.

As a result, we will no longer be providing updates or support for v2 (except for major security issues), and we will be closing any outstanding bug reports / feature requests related to v2. While we understand that some of you may still be using v2, we highly encourage you to upgrade to v3 to take advantage of the improved features and stability. If your request/bug still applies to v3, please open a new issue for it

farhatahmad avatar Feb 17 '23 15:02 farhatahmad