Skip to content

Commit

Permalink
fix sysv init scripts for centos6
Browse files Browse the repository at this point in the history
  • Loading branch information
kubicgruenfeld committed Nov 13, 2020
1 parent bb11665 commit a840120
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
.travis.yml:
docker_sets:
- set: centos6-64
- set: centos7-64
- set: centos8-64
- set: debian9-64
Expand Down
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ jobs:
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=centos6-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos6-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=centos7-64 CHECK=beaker
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/daemon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
'owner' => 'root',
'group' => 'root'
).with_content(
%r{daemon --user=smurf_user \\\n --pidfile="\$PID_FILE" \\\n "\$DAEMON" '' >> "\$LOG_FILE" 2>&1 &}
%r{daemon --user=smurf_user \\\n --pidfile="\$PID_FILE" \\\n "'\$DAEMON' '' >> '\$LOG_FILE' 2>&1 &"}
)
}

Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/files/prometheus1.sysv
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ start() {
[ -f $PID_FILE ] && rm $PID_FILE
daemon --user=prometheus \
--pidfile="$PID_FILE" \
"$DAEMON" -log.format logger:stdout -config.file=/etc/prometheus/prometheus.yaml \
"'$DAEMON' -log.format logger:stdout -config.file=/etc/prometheus/prometheus.yaml \
-web.console.templates=/usr/local/share/prometheus/consoles \
-web.console.libraries=/usr/local/share/prometheus/console_libraries \
-storage.local.path=/var/lib/prometheus \
-storage.local.retention=360h \
>> "$LOG_FILE" &
>> '$LOG_FILE' 2>&1 &"
retcode=$?
mkpidfile
touch /var/lock/subsys/prometheus
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/files/prometheus2.sysv
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ start() {
[ -f $PID_FILE ] && rm $PID_FILE
daemon --user=prometheus \
--pidfile="$PID_FILE" \
"$DAEMON" --config.file=/etc/prometheus/prometheus.yaml \
"'$DAEMON' --config.file=/etc/prometheus/prometheus.yaml \
--web.console.templates=/usr/local/share/prometheus/consoles \
--web.console.libraries=/usr/local/share/prometheus/console_libraries \
--storage.tsdb.path=/var/lib/prometheus \
--storage.tsdb.retention=360h \
>> "$LOG_FILE" &
>> '$LOG_FILE' 2>&1 &"
retcode=$?
mkpidfile
touch /var/lock/subsys/prometheus
Expand Down
2 changes: 1 addition & 1 deletion templates/daemon.sysv.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ start() {
daemon --user=<%= @user %> \
--pidfile="$PID_FILE" \
<%- require 'shellwords' -%>
"$DAEMON" <%= Shellwords.escape(@options) %> >> "$LOG_FILE" 2>&1 &
"'$DAEMON' <%= Shellwords.escape(@options) %> >> '$LOG_FILE' 2>&1 &"
retcode=$?
sleep 1
mkpidfile
Expand Down
4 changes: 2 additions & 2 deletions templates/prometheus.sysv.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ start() {
[ -f $PID_FILE ] && rm $PID_FILE
daemon --user=<%= scope.lookupvar('prometheus::server::user') %> \
--pidfile="$PID_FILE" \
"$DAEMON" <%= @daemon_flags.join(" \\\n ") %> \
>> "$LOG_FILE" &
"'$DAEMON' <%= @daemon_flags.join(" \\\n ") %> \
>> '$LOG_FILE' 2>&1 &"
retcode=$?
mkpidfile
touch /var/lock/subsys/prometheus
Expand Down

0 comments on commit a840120

Please sign in to comment.