Skip to content

Commit

Permalink
FIX #435 Adding loader and control functions
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Dec 13, 2014
1 parent b642574 commit 1b55f1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
${{loader-functions}}
${{control-functions}}

addGroup ${{daemon_group}}
addUser ${{daemon_user}} ${{daemon_group}} "${{app_name}} user-daemon" "${{daemon_shell}}"

startService ${{app_name}} || echo "${{app_name}} could not be registered or started"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
${{control-functions}}

# Removing system user/group : ${{daemon_user}} and ${{daemon_group}}

# Scriptlet syntax: http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
${{control-functions}}

# Adding system user/group : ${{daemon_user}} and ${{daemon_group}}
if ! getent group | grep -q "^${{daemon_group}}:" ;
then
echo "Creating system group: ${{daemon_group}}"
groupadd --system ${{daemon_group}}
fi
if ! getent passwd | grep -q "^${{daemon_user}}:";
then
echo "Creating system user: ${{daemon_user}}"
useradd --gid ${{daemon_group}} --no-create-home --system -c '${{app_name}} daemon-user' ${{daemon_user}}
fi

addGroup ${{daemon_group}}
addUser ${{daemon_user}} ${{daemon_group}} "${{app_name}} user-daemon" "${{daemon_shell}}"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
${{loader-functions}}

# Halting ${{app_name}}
echo "Shutdown ${{app_name}}"
service ${{app_name}} stop || echo "Could not stop ${{app_name}}"

0 comments on commit 1b55f1c

Please sign in to comment.