Adding init service and fixing the monitor.
This commit is contained in:
parent
ea44ffb8ff
commit
a0295ace2a
@ -56,7 +56,7 @@ EOF
|
||||
$started = !system 'ps', '-p', $pid;
|
||||
close $fh;
|
||||
}}
|
||||
$dbh->do( 'INSERT INTO monitor (date_execution, name, is_up) VALUES (?, ?);',
|
||||
$dbh->do( 'INSERT INTO monitor (date_execution, name, is_up) VALUES (?, ?, ?);',
|
||||
undef, DateTime->now() . '', $name, $started );
|
||||
if (!$started) {
|
||||
say "$name stopped";
|
||||
|
8
cualsead.init
Executable file
8
cualsead.init
Executable file
@ -0,0 +1,8 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Cualsead service monitor";
|
||||
|
||||
pidfile="/run/cualsea/cualsead.pid"
|
||||
command="cualsead"
|
||||
command_user="cualsea:cualsea"
|
||||
command_background="true"
|
@ -12,3 +12,4 @@ cd $current_dir/cualsea-cli &&
|
||||
sudo cpan . &&
|
||||
cd $current_dir/cualsea-server &&
|
||||
sudo cpan .
|
||||
sudo install -m 755 $current_dir/cualsead.init /etc/init.d/cualsead
|
||||
|
Loading…
Reference in New Issue
Block a user