-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
full systemd support #502
full systemd support #502
Conversation
Note that this pull request determines whether or not systemd is running on the fly, without needing to check any special config variables set during build time. This works properly, even if zmpkg.pl is called (by root) direct from the command line. This pull request makes policy kit a requirement (regardless of using systemd or not). I checked multiple Linux distros, and they all ship with polkit installed so I don't think this will be a problem. Only the zmsystemctl.pl script gets elevated permission and only when called by the webuser account. I did make some effort to make sure this pull request works with FreeBSD, but I am still not entirely certain wether polkit is installed by default or if the pull request is looking in the right path for the policy file folders (I had some trouble with my freebsd vm and have not taken the time to fix it). @PX03AFK I made an attempt to update your spec file for openesuse. Please verify. |
I found a couple of things which need to be added. In configure_file(zmsystemctl.pl "${CMAKE_CURRENT_BINARY_DIR}/zmsystemctl.pl" otherwise zmsystemctl.pl doesn't get into the build structure. I think you also need to add scripts/zmsystemctl.pl to configure.ac. Still need to a little more checking for a complete build and am intending Like the solution though. From: Andrew Bauer [mailto:notifications@github.com] Note that this pull request determines whether or not systemd is running on This pull request makes policy kit a requirement (regardless of using I did make some effort to make sure this pull request works with FreeBSD, @PX03AFK https://github.com/PX03AFK I made an attempt to update your spec Reply to this email directly or view |
Thanks for the feedback. Adding zmsystemctl.pl to configure.ac causes autotools to look for a "zmsystemctl.pl.in" and the build then fails becuase there isn't one. ...that's also why I didn't add a similar statement to cmakelists.txt. The rpms I've built off this do contain zmsystemctl.pl, but you may still be right about the cmake change. I'll look into it tonight. The generic service file came from @barjac 's Maegia zoneminder rpm. It looked like a good starting point, and due to the nature of systemd I think we may be able to get away with the same service file across all linux distros. |
The problem is only with zmsystemctl.pl. Even if you renamed it you would I've also discovered that there is a complimentary %cmake_install which The point I was trying to make is that at present it appears that OpenSuse From: Andrew Bauer [mailto:notifications@github.com] In the grand scheme of things, this particular pull request aside, does Maybe I misread your intentions, but what I understood was that, there was If this is not the case then you have my apologies as I misunderstood you. Let me know. Reply to this email directly or view |
@@ -123,6 +123,18 @@ if ( $command eq "state" ) | |||
$command = "restart"; | |||
} | |||
|
|||
# Check if we are running systemd and if we have been called by the system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm just picky, but I'd rather see this whole block go away, and the below if ( systemdRunning() )
block go into its own sub, which is called from the existing if ( $command
blocks. Otherwise looks OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with this, but I think I'd rather do that in a separate pull request. If you look at the entire zmpkg, I'd argue that every single one of the if ( $command
blocks should be in its own sub. So if I can get you to agree to compromise, I'd ask you to merge the systemd pull request first, and then I'll open new pull request after I re-write the entire zmpkg.
This looks OK to merge. I don't see anything which would break existing systems. |
I've been trying to get ZM running on CentOS 7 with some success but the systemd start up script is still hit and miss, we need more to be included so the install can be as simple as the old sys v scripts. This might be a dumb reply and once I've put my developer hat fully back on I'm willing to contribute to improve the systemd install process but some initial guidance as to how you have modified ZM to run with systemd is needed. Step 10, simply copying the default script isnt that helpful.... |
See my responses for how to build and configure zoneminder on CentOS 7 in this forum thread: Make sure you don't have the legacy init script under /etc/init.d. That is guaranteed to break things. |
This method combines ideas from the previous two pull requests. zmpkg will automatically detect that systemd is running, and it will automatically redirect any start/stop/restart commands through systemctl.