Adding init service and fixing the monitor.

This commit is contained in:
sergiotarxz 2021-11-14 00:33:34 +01:00
parent ea44ffb8ff
commit a0295ace2a
3 changed files with 10 additions and 1 deletions

View File

@ -56,7 +56,7 @@ EOF
$started = !system 'ps', '-p', $pid; $started = !system 'ps', '-p', $pid;
close $fh; 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 ); undef, DateTime->now() . '', $name, $started );
if (!$started) { if (!$started) {
say "$name stopped"; say "$name stopped";

8
cualsead.init Executable file
View 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"

View File

@ -12,3 +12,4 @@ cd $current_dir/cualsea-cli &&
sudo cpan . && sudo cpan . &&
cd $current_dir/cualsea-server && cd $current_dir/cualsea-server &&
sudo cpan . sudo cpan .
sudo install -m 755 $current_dir/cualsead.init /etc/init.d/cualsead