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

Notify tunnel up to systemd with sd_notify #370

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

fsateler
Copy link
Contributor

Allows usage of Type=notify systemd service types.

Fixes: #229

Allows usage of Type=notify systemd service types.

Fixes: adrienverge#229
@DimitriPapadopoulos DimitriPapadopoulos merged commit d2d4bdf into adrienverge:master Sep 12, 2018
@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Sep 12, 2018

Perhaps this functionality would be best left to a pppd startup script (in /etc/ppp/ip-up). However this is a small patch which helps delegate functionality to systemd and therefore possibly avoid future options and duplication of functionality in openfortivpn. So I'm happy to add it.

But keep in mind that notifying the pppd tunnel is up is best left to pppd itself. Unfortunately pppd doesn't provide much more than scripts in /etc/ppp/ip-up or /etc/ppp/ip-down (and /etc/ppp/ipv6-up and /etc/ppp/ipv6-down the day IPv6 is supported). Perhaps the proper way to handle this would be to have future versions of pppd notify systemd and/or accept more options from users.

What do you think?

@fsateler fsateler deleted the systemd-notify branch September 12, 2018 15:16
@fsateler
Copy link
Contributor Author

Hi @DimitriPapadopoulos

Thanks for merging.

I don't have much knowledge about how this works. I basically grepped for 'Tunnel is up', put the sd_notify there, and verified it worked for my usecase.

The problem with moving this functionality into pp is that ppp may be used by other things, or the user might not be aware that ppp is a thing. Indeed, I (as user) don't have much interest in knowing which part of the job is being done by ppp and which is being done by openfortivpn. So it seems to me that, as long as openfortivpn is the user-facing program, it should somehow provide a notification that the vpn is up.

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Sep 12, 2018

It's just that there are so many ways of notifying of events: systemd on servers, D-Bus on desktops, etc.

openfortivpn cannot handle all these channels. It is up to the integrator (Linux distribution ?) to make sure pppd properly notifies of up/down and other events. Then users can subscribe to the proper channel if they are interested.

Worst case, it is up to the openfortivpn installation script to install the machinery, probably as scripts in /etc/ppp or as a pppd plugin that notify systemd and D-Bus of pppd events.

That's theory. In practice I am happy to merge your patch until theory becomes reality...

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