Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ship a systemd drop-in example (to e.g. add a --listen option) and document it #26

Open
gduprey opened this issue May 6, 2017 · 7 comments
Assignees
Milestone

Comments

@gduprey
Copy link

gduprey commented May 6, 2017

I run lightsd with -l to allow connections from network based clients. I recently updated my OS to ubuntu 16.04 and lightsd to 1.2.1 and noticed it was no longer paying attention to my DAEMON_OPTS= line in /etc/default/lightsd. This is due to using systemd now, which is fine, but might be worth mentioning that /etc/default/lightsd isn't used on systemd systems and changes to options should be done in the service file.

Just a suggestion.

@lopter
Copy link
Owner

lopter commented May 7, 2017

Hello @gduprey,

Sorry for the troubles, I think a better approach will be to ship a systemd drop-in (see systemd.unit(5)) with the examples and explain how to use it to in the documentation.

Let me know what you think.

Thanks for the report!

@lopter lopter self-assigned this May 7, 2017
@lopter lopter added this to the 1.2.2 milestone May 7, 2017
@gduprey
Copy link
Author

gduprey commented May 7, 2017

It wasn't much of a trouble. And I think the drop in or just updates to docs (where to apply the change for listening on a network port -- for upstart and systemd) would be fine. It wasn't a big deal, just unexpected and took about 10 minutes to figure out.

Gerry

@lopter lopter changed the title On systemd based systems, /etc/default/lightsd is ignored Ship a systemd drop-in example (to e.g. add a --listen option) and document it May 8, 2017
@lopter
Copy link
Owner

lopter commented May 18, 2017

Not released nor documented yet but I just pushed an example systemd drop-in:

https://github.com/lopter/lightsd/blob/master/examples/custom-exec-start.conf

@gduprey
Copy link
Author

gduprey commented May 18, 2017

So this is just an example of modifying the supplied dist/lightsd.service to enable the network listener when using a systemd based install, correct? Might be worth a mention in there or elsewhere that this is how you enable network for a systemd system and that the /etc/default/lightsd is ignored in that case (or add it to the distribution /etc/default/lightsd in comments that it's not applicable for systemd based systems).

I thought the dist/lightsd.service was a well done file, just didn't know I had to alter it to enable network listening. So anything to just make a pointer to where to do it should be of use to folks going forward.

@lopter
Copy link
Owner

lopter commented May 18, 2017

No, the custom-exec-start.conf file linked previously goes under /etc/systemd/system/lightsd.service.d and overrides values from lightsd.service as explained in the documentation I linked in my first answer.

This will get documented on the lightsd side!

@gduprey
Copy link
Author

gduprey commented May 19, 2017

That's great! Still a novice on using systemd config files and didn't know you could have override files with just select key replacement. That's good to know and I agree -- with that option, adding network support with such a thing is a very clean solution

@pdf
Copy link

pdf commented Jun 4, 2019

Could just read and use the /etc/default/lightsd file, rather than requiring overrides:

--- lightsd.service     2017-02-13 06:55:34.000000000 +1100
+++ lightsd.service     2019-06-05 01:00:31.631523776 +1000
@@ -3,7 +3,8 @@
 After=network.target
 
 [Service]
-ExecStart=/usr/bin/lightsd -t -v warning -s %t/lightsd/socket -c %t/lightsd/pipe
+EnvironmentFile=-/etc/default/lightsd
+ExecStart=/usr/bin/lightsd -t -v warning -s %t/lightsd/socket -c %t/lightsd/pipe $DAEMON_OPTS
 User=lightsd
 Group=lightsd
 RuntimeDirectory=lightsd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants