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

Add systemd service unit #29

Merged
merged 1 commit into from
Sep 10, 2012
Merged

Add systemd service unit #29

merged 1 commit into from
Sep 10, 2012

Conversation

tlvince
Copy link
Contributor

@tlvince tlvince commented Sep 9, 2012

This adds a basic systemd.service unit for redsocks.

I maintain the redsocks package for Arch Linux, which is transitioning away
from sysvinit to systemd. Although I'm new to systemd, it is my
understanding that one advantage of it is it allows for rc scripts to be
maintained upstream rather than multiple idiosyncratic scripts per distribution.

Note, I labelled it 'basic' as it also highlights a feature request for
redsocks: a -u, --user option that allows redsocks to drop root privileges
and switch to the given userid. This will mean su can be removed and simplify
the service file.

@darkk
Copy link
Owner

darkk commented Sep 10, 2012

Well, I assume you're wrong about mainline maintenance. E.g. ubuntu have chosen upstart init replacement instead of systemd, so... :) I can include systemd.service, but I can't properly maintain as soon as I don't have Arch installation.

As far as I know, it's bad practice to use su in init scripts. The reason is described here: http://upstart.ubuntu.com/cookbook/#changing-user

su(1) must fork to be able to hold its PAM session open

On the other hand it matters iff PAM is broken as redsocks forks and su will close PAM session after second fork. Also, redsocks has to be started as root for UDP redirection to work and it probably should have non-forking option for systemd/upstart init systems to have cleaner restart-on-crash policy.

darkk added a commit that referenced this pull request Sep 10, 2012
Add systemd service unit
@darkk darkk merged commit d8d521c into darkk:master Sep 10, 2012
This was referenced Sep 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants