Service files

This commit is contained in:
David Young
2026-04-13 15:50:47 -06:00
parent 702d5d1140
commit 02c1d70afe
5 changed files with 39 additions and 21 deletions

View File

@@ -10,4 +10,10 @@ fi
cd "$HOME/.local/bin/openhamclock" && npm install
mkdir -p "$HOME/.config/systemd/user"
cp "$HOME/.local/share/HamPackServer/servicefiles/openhamclock.service" "$HOME/.config/systemd/user/"
systemctl --user daemon-reload
systemctl --user enable --now openhamclock
echo "openhamclock is installed"...

View File

@@ -70,6 +70,11 @@ cp "$HOME/.local/share/HamPackServer/hampackserverupdate" "$HOME/.local/bin/hamp
cp "$HOME/.local/share/HamPackServer/scripts/start-hamclock.sh" "$HOME/.local/bin/start-hamclock.sh"
chmod +x "$HOME/.local/bin/start-hamclock.sh"
mkdir -p "$HOME/.config/systemd/user"
cp "$HOME/.local/share/HamPackServer/servicefiles/hamclock.service" "$HOME/.config/systemd/user/"
systemctl --user daemon-reload
systemctl --user enable --now hamclock
cd ~/.local/share/HamPackServer
echo "Updating system..."
@@ -109,22 +114,6 @@ source packages.conf
echo "Installing servers..."
install_packages "${SERVERS[@]}"
# Initialize and start MariaDB if not already running
if ! systemctl is-active --quiet mariadb; then
if [ ! -d /var/lib/mysql/mysql ]; then
echo "Initializing MariaDB..."
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
fi
echo "Starting MariaDB..."
sudo systemctl enable --now mariadb
fi
# Start Apache if not already running
if ! systemctl is-active --quiet httpd; then
echo "Starting Apache..."
sudo systemctl enable --now httpd
fi
echo "Installing utilities..."
install_packages "${UTILITIES[@]}"
@@ -227,7 +216,7 @@ else
fi
if [ -n "$WAVELOG_DB_PASS" ]; then
echo ""
echo "Wavelog database password: $WAVELOG_DB_PASS. Please save this."
echo "Wavelog database password: $WAVELOG_DB_PASS (Please save this.)"
echo "(also stored in $WAVELOG_DIR/docker-compose.yaml)"
fi
echo ""

View File

@@ -1,7 +1,6 @@
# Ham servers
SERVERS=(
apache
mariadb
# nothing at this time
)
# Ham server utilities
@@ -17,8 +16,6 @@ UTILITIES=(
nano
nodejs
npm
php
php-apache
vi
wget
unzip

View File

@@ -0,0 +1,13 @@
[Unit]
Description=HamClock
After=network.target
[Service]
Type=simple
WorkingDirectory=%h/.local/bin/
ExecStart=%h/.local/bin/hamclock
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,13 @@
[Unit]
Description=OpenHamClock
After=network.target
[Service]
Type=simple
WorkingDirectory=%h/.local/bin/openhamclock
ExecStart=/usr/bin/pm2 start server.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target