diff --git a/distros/fedora/CMakeLists.txt b/distros/fedora/CMakeLists.txt index 507c99293..c6f07c2e6 100644 --- a/distros/fedora/CMakeLists.txt +++ b/distros/fedora/CMakeLists.txt @@ -4,15 +4,16 @@ message([STATUS] "Starting Fedora Build Options" ...) # Process config files -configure_file(zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) configure_file(zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY) configure_file(zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY) if(ZM_WEB_USER STREQUAL "nginx") configure_file(nginx/zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY) + configure_file(nginx/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) configure_file(nginx/zoneminder.php-fpm.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.php-fpm.conf @ONLY) configure_file(nginx/README.Fedora ${CMAKE_CURRENT_SOURCE_DIR}/README.Fedora COPYONLY) else(ZM_WEB_USER STREQUAL "nginx") configure_file(zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY) + configure_file(zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY) endif(ZM_WEB_USER STREQUAL "nginx") # Unpack jscalendar & move files into position diff --git a/distros/fedora/nginx/zoneminder.service.in b/distros/fedora/nginx/zoneminder.service.in new file mode 100644 index 000000000..55a59d106 --- /dev/null +++ b/distros/fedora/nginx/zoneminder.service.in @@ -0,0 +1,19 @@ +# ZoneMinder systemd unit file for Fedora +# Replace mariadb with community-mysql if using mysql service instead of mariadb + +[Unit] +Description=ZoneMinder CCTV recording and security system +After=network.target mariadb.service nginx.service php-fpm.service fcgiwrap.service +Requires=mariadb.service nginx.service php-fpm.service fcgiwrap.service + +[Service] +User=@WEB_USER@ +Type=forking +ExecStart=@BINDIR@/zmpkg.pl start +ExecReload=@BINDIR@/zmpkg.pl restart +ExecStop=@BINDIR@/zmpkg.pl stop +PIDFile="@ZM_RUNDIR@/zm.pid" +Environment=TZ=/etc/localtime + +[Install] +WantedBy=multi-user.target