Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Add a unit file to manage helios-agent service (#1265)
Browse files Browse the repository at this point in the history
* Add a unit file to manage helios-agent service

This sets up helios-agent to be configured as a daemon and managed via systemd

Change unit file install path

Add comment to wrapper script

Add `After` directive to unit file

* Add unit file for helios-master
  • Loading branch information
vbhavsar authored Jan 10, 2019
1 parent 268dd6f commit 5ac4abb
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
36 changes: 36 additions & 0 deletions helios-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,24 @@
<filemode>755</filemode>
</mapper>
</data>
<data>
<src>${project.parent.basedir}/src/deb/helios-master/helios-master.service</src>
<type>file</type>
<dst>/etc/systemd/system/helios-master.service</dst>
<mapper>
<type>perm</type>
<filemode>755</filemode>
</mapper>
</data>
<data>
<src>${project.parent.basedir}/src/deb/helios-master/helios-master-wrapper</src>
<type>file</type>
<dst>/usr/bin/helios-master-wrapper</dst>
<mapper>
<type>perm</type>
<filemode>755</filemode>
</mapper>
</data>
</dataSet>
</configuration>
</execution>
Expand Down Expand Up @@ -552,6 +570,24 @@
<filemode>755</filemode>
</mapper>
</data>
<data>
<src>${project.parent.basedir}/src/deb/helios-agent/helios-agent.service</src>
<type>file</type>
<dst>/etc/systemd/system/helios-agent.service</dst>
<mapper>
<type>perm</type>
<filemode>755</filemode>
</mapper>
</data>
<data>
<src>${project.parent.basedir}/src/deb/helios-agent/helios-agent-wrapper</src>
<type>file</type>
<dst>/usr/bin/helios-agent-wrapper</dst>
<mapper>
<type>perm</type>
<filemode>755</filemode>
</mapper>
</data>
</dataSet>
</configuration>
</execution>
Expand Down
12 changes: 12 additions & 0 deletions src/deb/helios-agent/helios-agent-wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# This wrapper script allows initialization of
# environment variables since systemd's Environment and
# EnvironmentFile directives don't support running
# arbitrary commands.

DEFAULTFILE=/etc/default/helios-agent

[ -f $DEFAULTFILE ] && . $DEFAULTFILE

exec /usr/bin/helios-agent ${HELIOS_AGENT_OPTS}
10 changes: 10 additions & 0 deletions src/deb/helios-agent/helios-agent.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Helios agent daemon
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/helios-agent-wrapper
User=helios

12 changes: 12 additions & 0 deletions src/deb/helios-master/helios-master-wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# This wrapper script allows initialization of
# environment variables since systemd's Environment and
# EnvironmentFile directives don't support running
# arbitrary commands.

DEFAULTFILE=/etc/default/helios-master

[ -f $DEFAULTFILE ] && . $DEFAULTFILE

exec /usr/bin/helios-master ${HELIOS_MASTER_OPTS}
10 changes: 10 additions & 0 deletions src/deb/helios-master/helios-master.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Helios master daemon
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/helios-master-wrapper
User=helios

0 comments on commit 5ac4abb

Please sign in to comment.