aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--make/configure.pm8
-rw-r--r--make/template/inspircd.openrc2
-rw-r--r--make/template/inspircd.service5
-rw-r--r--make/template/logrotate2
-rw-r--r--make/template/org.inspircd.plist8
5 files changed, 17 insertions, 8 deletions
diff --git a/make/configure.pm b/make/configure.pm
index 0904752fd..1f7f9eb6a 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -298,6 +298,14 @@ sub parse_templates($$$) {
} else {
push @lines, "#${indent}undef $value";
}
+ } elsif ($name eq 'ifdef') {
+ if ($name =~ /^(\S+)\s+(.+)/ && $settings{$1}) {
+ push @lines, $indent . $2;
+ }
+ } elsif ($name eq 'ifndef') {
+ if ($3 =~ /^(\S+)\s+(.+)/ && !$settings{$1}) {
+ push @lines, $indent . $2;
+ }
} elsif ($name eq 'mode') {
$mode = oct $value;
} elsif ($name eq 'platform') {
diff --git a/make/template/inspircd.openrc b/make/template/inspircd.openrc
index 8f755bb91..30b15edfa 100644
--- a/make/template/inspircd.openrc
+++ b/make/template/inspircd.openrc
@@ -24,7 +24,7 @@ description="InspIRCd - Internet Relay Chat Daemon"
command="@BINARY_DIR@/inspircd"
command_args="--nofork --nopid"
-command_user="@USER@:@GROUP@"
+%ifndef DISABLE_OWNERSHIP command_user="@USER@:@GROUP@"
pidfile="@RUNTIME_DIR@/${RC_SVCNAME}.pid"
supervisor="supervise-daemon"
diff --git a/make/template/inspircd.service b/make/template/inspircd.service
index c92206e0a..bc8cdc14e 100644
--- a/make/template/inspircd.service
+++ b/make/template/inspircd.service
@@ -32,8 +32,9 @@ ExecReload=/bin/kill -HUP $MAINPID
ExecStart=@BINARY_DIR@/inspircd --nofork --nopid
Restart=on-failure
Type=simple
-User=@USER@
-Group=@GROUP@
+%ifdef DISABLE_OWNERSHIP DynamicUser=yes
+%ifndef DISABLE_OWNERSHIP User=@USER@
+%ifndef DISABLE_OWNERSHIP Group=@GROUP@
[Install]
WantedBy=multi-user.target
diff --git a/make/template/logrotate b/make/template/logrotate
index 65cb4c8d7..345824e52 100644
--- a/make/template/logrotate
+++ b/make/template/logrotate
@@ -21,7 +21,7 @@
@LOG_DIR@/*.log {
compress
- create 0644 @USER@ @GROUP@
+ %ifndef DISABLE_OWNERSHIP create 0644 @USER@ @GROUP@
dateext
delaycompress
missingok
diff --git a/make/template/org.inspircd.plist b/make/template/org.inspircd.plist
index ae4e90916..6375573bb 100644
--- a/make/template/org.inspircd.plist
+++ b/make/template/org.inspircd.plist
@@ -26,9 +26,9 @@
<string>@LOG_DIR@/launchd-stdout.log</string>
<key>StandardErrorPath</key>
<string>@LOG_DIR@/launchd-stderr.log</string>
- <key>UserName</key>
- <string>@USER@</string>
- <key>GroupName</key>
- <string>@GROUP@</string>
+ %ifndef DISABLE_OWNERSHIP <key>UserName</key>
+ %ifndef DISABLE_OWNERSHIP <string>@USER@</string>
+ %ifndef DISABLE_OWNERSHIP <key>GroupName</key>
+ %ifndef DISABLE_OWNERSHIP <string>@GROUP@</string>
</dict>
</plist>