Closed gonzoleeman closed 9 years ago
Note: I believe I was in error when suggesting that target-isns can be socket-activated. That is only appropriate for a daemon serving requests. Not sure what I was smoking ...
Okay, I have this working and can easily set up a pull request. But the deeper question is do you have any objections to adding systemd support? I don't see any way this could hurt on systems that don't have systemd support, except that if they run "make install" or build/install from the RPM spec file, an attempt will be made to install the file target-isns.service in the directory /usr/lib/systemd/system. This directory will not exist on such systems.
I believe the SPEC file can stand as is, since it's something I added an probably not used by many folks yet. So perhaps it's safe to assume that if you use the SPEC file it's on a newer system and you have to have systemd.
But I hate to add that assumption to the CMakeLists.txt file. What's the best way to make an install target condition on something, perhaps a command-line option, with CMake? (I'll look it up, but I bet you know already.)
All figured out. Please let me know if you'd like to see the changes/diffs, or if you'd like me to just submit a pull request.
The deeper question is do you have any objections to adding systemd support?
No objection. That's great to add support for systemd. Moreover, unlike an init script which is different from one distribution to the other, a single systemd unit file should work on all distros that support systemd.
I thought that supporting systemd was just a matter of adding a systemd unit file, but you write that we need socket activation too. Target-isns is a iSNS client and not a server: it never calls listen()
. So why is socket activation needed?
The only place where listen()
is invoked is for State Change Notifications (SCN). But right now, SCN is disabled.
All figured out. Please let me know if you'd like to see the changes/diffs, or if you'd like me to just submit a pull request.
Please send a pull request. Thank you!
Merged. Thank you!
Whether we like it or not, most modern Linux systems are using systemd now.
I am having to add systemd support for my own purposes and wanted to know if you'd like those changes here.
They would involve:
This will configure the isns daemon to be socket-activated by systemd, so that the daemon only gets started when somebody tries to access it.
I will prepare a pull request if you are interested in this code.