summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2020-04-22 15:23:05 -0600
committerTodd C. Miller <Todd.Miller@sudo.ws>2020-04-22 15:23:05 -0600
commit8f6119020bd40cac9c1447082162361d7a84c3ca (patch)
tree5dc03ea0479fa90ea6173de2432e725e568b07cc
parent611a2248735162f5d8869750b4712707ebfc1c3f (diff)
downloadsudo-8f6119020bd40cac9c1447082162361d7a84c3ca.tar.gz
Fix support for pp_systemd_disabled and check for systemd existence.
On our build schroots we don't have systemctl installed but do have the /etc/systemd and /lib/systemd (or /usr/lib/systemd) directories.
-rw-r--r--etc/sudo-logsrvd.pp8
-rwxr-xr-xscripts/pp18
2 files changed, 13 insertions, 13 deletions
diff --git a/etc/sudo-logsrvd.pp b/etc/sudo-logsrvd.pp
index cbd35dcbc..fa908a4a9 100644
--- a/etc/sudo-logsrvd.pp
+++ b/etc/sudo-logsrvd.pp
@@ -224,10 +224,10 @@ This makes it possible to have all sudo I/O logs on a central server."
pp_macos_service_id=ws.sudo.sudo_logsrvd
%endif
%if [rpm,deb]
- # Only include systemd support if we find systemctl on the build
- # machine. This assumes that we are building on the same distro
- # that the package will be installed on.
- if command -v systemctl >/dev/null; then
+ # Only include systemd support if it exists on the build machine.
+ # This assumes that we are building on the same distro that the
+ # package will be installed on (which is the case for sudo).
+ if test -d /etc/systemd; then
for d in `pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null` /lib/systemd/system /usr/lib/systemd/system; do
if test -d "$d"; then
break
diff --git a/scripts/pp b/scripts/pp
index 4e9f199d1..3628f68af 100755
--- a/scripts/pp
+++ b/scripts/pp
@@ -4079,8 +4079,8 @@ pp_deb_handle_services() {
pp_load_service_vars $svc
# Create init script and systemd service file (unless they exists)
- pp_deb_service_make_init_script $svc ||
- pp_error "could not create init script for service $svc"
+ pp_deb_service_make_service_files $svc ||
+ pp_error "could not create service files for $svc"
#-- append %post code to install the svc
test x"yes" = x"$enable" &&
@@ -4511,7 +4511,7 @@ pp_backend_deb_init_svc_vars () {
stop_priority=50 #-- stop_priority = 100 - start_priority
}
-pp_deb_service_make_init_script () {
+pp_deb_service_make_service_files () {
local svc=${svc_init_filename:-$1}
local script="${svc_init_filepath:-"/etc/init.d"}/$svc"
local out=$pp_destdir$script
@@ -5883,8 +5883,8 @@ pp_backend_rpm () {
for svc in $pp_services; do
pp_load_service_vars $svc
- pp_rpm_service_make_init_script $svc ||
- pp_error "could not create init script for service $svc"
+ pp_rpm_service_make_service_files $svc ||
+ pp_error "could not create service files for $svc"
#-- append %post code to install the svc
pp_rpm_service_install $svc >> $pp_wrkdir/%post.run
@@ -6412,7 +6412,7 @@ pp_rpm_service_group_make_init_script () {
chmod 755 $out
}
-pp_rpm_service_make_init_script () {
+pp_rpm_service_make_service_files () {
local svc=${svc_init_filename:-$1}
local script="${svc_init_filepath:-"/etc/init.d"}/$svc"
local out=$pp_destdir$script
@@ -8808,7 +8808,7 @@ pp_backend_bsd_function() {
pp_systemd_make_service_file() {
local svc f
- if [ "${pp_systemd_disabled}:-false" = "true" ]; then
+ if [ "${pp_systemd_disabled:-false}" = "true" ]; then
return
fi
@@ -8885,7 +8885,7 @@ pp_systemd_service_init_common () {
}
pp_systemd_service_install_common () {
- if [ "${pp_systemd_disabled}:-false" = "true" ]; then
+ if [ "${pp_systemd_disabled:-false}" = "true" ]; then
cat<<'.'
# systemd support disabled
@@ -8970,7 +8970,7 @@ pp_systemd_service_install_common () {
}
pp_systemd_service_remove_common () {
- if [ "${pp_systemd_disabled}:-false" = "true" ]; then
+ if [ "${pp_systemd_disabled:-false}" = "true" ]; then
cat<<'.'
# systemd support disabled