Skip to content

Commit

Permalink
Added example script systemv
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Nov 14, 2024
1 parent ae54095 commit f15999a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ go.work.sum

# Binary
acsls-agent
acsls-agent.solaris-amd64

52 changes: 52 additions & 0 deletions systemv/acsls-agent.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
#
# chkconfig: 2345 90 12
# description: InfraSonar ACSLS Agent
#

# Get function from functions library
. /etc/init.d/functions

# Start the InfraSonar ACSLS Agent
start() {
initlog -c "echo -n Starting InfraSonar ACSLS Agent: "
export PATH="$PATH:/export/home/ACSSS/bin"
export TOKEN=<TOKEN>
export ASSET_ID=<ASSET_ID>
su - acsss -c -p "/usr/bin/acsls-agent" &
### Create the lock file ###
touch /var/lock/subsys/acsls-agent
success $"InfraSonar ACSLS Agent startup"
echo
}

# Restart the InfraSonar ACSLS Agent
stop() {
initlog -c "echo -n Stopping InfraSonar ACSLS Agent: "
killproc acsls-agent
### Now, delete the lock file ###
rm -f /var/lock/subsys/acsls-agent
echo
}

### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status acsls-agent
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac

exit 0

0 comments on commit f15999a

Please sign in to comment.