Introduce ZM_PATH_SHUTDOWN to cmake config

This commit is contained in:
Isaac Connor 2019-05-27 12:09:32 -04:00
parent ac8197f2e5
commit c4d76f03c9
6 changed files with 12 additions and 6 deletions

View File

@ -166,6 +166,8 @@ set(ZM_DIR_SOUNDS "sounds" CACHE PATH
"Location to look for optional sound files, default: sounds") "Location to look for optional sound files, default: sounds")
set(ZM_PATH_ZMS "/cgi-bin/nph-zms" CACHE PATH set(ZM_PATH_ZMS "/cgi-bin/nph-zms" CACHE PATH
"Web url to zms streaming server, default: /cgi-bin/nph-zms") "Web url to zms streaming server, default: /cgi-bin/nph-zms")
set(ZM_PATH_SHUTDOWN "/sbin/shutdown" CACHE PATH
"Path to shutdown binary, default: /sbin/shutdown")
# Advanced # Advanced
set(ZM_PATH_MAP "/dev/shm" CACHE PATH set(ZM_PATH_MAP "/dev/shm" CACHE PATH

View File

@ -21,10 +21,11 @@ override_dh_auto_configure:
-DZM_CGIDIR=/usr/lib/zoneminder/cgi-bin \ -DZM_CGIDIR=/usr/lib/zoneminder/cgi-bin \
-DZM_WEB_USER=www-data \ -DZM_WEB_USER=www-data \
-DZM_WEB_GROUP=www-data \ -DZM_WEB_GROUP=www-data \
-DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \ -DZM_CONFIG_SUBDIR="/etc/zm/conf.d" \
-DZM_CONFIG_DIR="/etc/zm" \ -DZM_CONFIG_DIR="/etc/zm" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" -DZM_PATH_SHUTDOWN="/sbin/shutdown" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_auto_install: override_dh_auto_install:
dh_auto_install --buildsystem=cmake dh_auto_install --buildsystem=cmake

View File

@ -27,6 +27,7 @@ override_dh_auto_configure:
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \ -DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \ -DZM_CACHEDIR="/var/cache/zoneminder/cache" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_PATH_SHUTDOWN="/sbin/shutdown" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" -DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_clean: override_dh_clean:

View File

@ -27,6 +27,7 @@ override_dh_auto_configure:
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \ -DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
-DZM_CACHEDIR="/var/cache/zoneminder/cache" \ -DZM_CACHEDIR="/var/cache/zoneminder/cache" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \ -DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_PATH_SHUTDOWN="/sbin/shutdown" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms" -DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
override_dh_clean: override_dh_clean:

View File

@ -10,6 +10,7 @@ configure_file(com.zoneminder.systemctl.rules.in "${CMAKE_CURRENT_BINARY_DIR}/co
configure_file(zoneminder.service.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder.service" @ONLY) configure_file(zoneminder.service.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder.service" @ONLY)
configure_file(zoneminder-tmpfiles.conf.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder-tmpfiles.conf" @ONLY) configure_file(zoneminder-tmpfiles.conf.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder-tmpfiles.conf" @ONLY)
configure_file(zoneminder.desktop.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder.desktop" @ONLY) configure_file(zoneminder.desktop.in "${CMAKE_CURRENT_BINARY_DIR}/zoneminder.desktop" @ONLY)
configure_file(zm-sudo.in "${CMAKE_CURRENT_BINARY_DIR}/zm-sudo" @ONLY)
# Do not install the misc files by default # Do not install the misc files by default
#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apache.conf" "${CMAKE_CURRENT_BINARY_DIR}/logrotate.conf" "${CMAKE_CURRENT_BINARY_DIR}/syslog.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/misc") #install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apache.conf" "${CMAKE_CURRENT_BINARY_DIR}/logrotate.conf" "${CMAKE_CURRENT_BINARY_DIR}/syslog.conf" DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/misc")

View File

@ -27,18 +27,18 @@ if ( $action ) {
if ( $action == 'shutdown' ) { if ( $action == 'shutdown' ) {
$output = array(); $output = array();
$rc = 0; $rc = 0;
exec("sudo -n /sbin/shutdown -P $when 2>&1", $output, $rc); exec('sudo -n '.ZM_PATH_SHUTDOWN." -P $when 2>&1", $output, $rc);
#exec('sudo -n /bin/systemctl poweroff -i 2>&1', $output, $rc); #exec('sudo -n /bin/systemctl poweroff -i 2>&1', $output, $rc);
ZM\Logger::Debug("Shutdown output $rc " . implode("\n",$output)); ZM\Logger::Debug("Shutdown output $rc " . implode("\n",$output));
#ZM\Logger::Debug("Shutdown output " . shell_exec('/bin/systemctl poweroff -i 2>&1')); #ZM\Logger::Debug("Shutdown output " . shell_exec('/bin/systemctl poweroff -i 2>&1'));
} else if ( $action == 'restart' ) { } else if ( $action == 'restart' ) {
$output = array(); $output = array();
exec("sudo -n /sbin/shutdown -r $when 2>&1", $output); exec('sudo -n '.ZM_PATH_SHUTDOWN." -r $when 2>&1", $output);
#exec('sudo -n /bin/systemctl reboot -i 2>&1', $output); #exec('sudo -n /bin/systemctl reboot -i 2>&1', $output);
ZM\Logger::Debug("Shutdown output " . implode("\n",$output)); ZM\Logger::Debug("Shutdown output " . implode("\n",$output));
} else if ( $action == 'cancel' ) { } else if ( $action == 'cancel' ) {
$output = array(); $output = array();
exec('sudo /sbin/shutdown -c 2>&1', $output); exec('sudo '.ZM_PATH_SHUTDOWN.' -c 2>&1', $output);
} }
} # end if action } # end if action
?> ?>