Service files
This commit is contained in:
@@ -10,4 +10,10 @@ fi
|
|||||||
|
|
||||||
cd "$HOME/.local/bin/openhamclock" && npm install
|
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"...
|
echo "openhamclock is installed"...
|
||||||
23
install.sh
23
install.sh
@@ -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"
|
cp "$HOME/.local/share/HamPackServer/scripts/start-hamclock.sh" "$HOME/.local/bin/start-hamclock.sh"
|
||||||
chmod +x "$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
|
cd ~/.local/share/HamPackServer
|
||||||
|
|
||||||
echo "Updating system..."
|
echo "Updating system..."
|
||||||
@@ -109,22 +114,6 @@ source packages.conf
|
|||||||
echo "Installing servers..."
|
echo "Installing servers..."
|
||||||
install_packages "${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..."
|
echo "Installing utilities..."
|
||||||
install_packages "${UTILITIES[@]}"
|
install_packages "${UTILITIES[@]}"
|
||||||
|
|
||||||
@@ -227,7 +216,7 @@ else
|
|||||||
fi
|
fi
|
||||||
if [ -n "$WAVELOG_DB_PASS" ]; then
|
if [ -n "$WAVELOG_DB_PASS" ]; then
|
||||||
echo ""
|
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)"
|
echo "(also stored in $WAVELOG_DIR/docker-compose.yaml)"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Ham servers
|
# Ham servers
|
||||||
SERVERS=(
|
SERVERS=(
|
||||||
apache
|
# nothing at this time
|
||||||
mariadb
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ham server utilities
|
# Ham server utilities
|
||||||
@@ -17,8 +16,6 @@ UTILITIES=(
|
|||||||
nano
|
nano
|
||||||
nodejs
|
nodejs
|
||||||
npm
|
npm
|
||||||
php
|
|
||||||
php-apache
|
|
||||||
vi
|
vi
|
||||||
wget
|
wget
|
||||||
unzip
|
unzip
|
||||||
|
|||||||
13
servicefiles/hamclock.service
Normal file
13
servicefiles/hamclock.service
Normal 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
|
||||||
13
servicefiles/openhamclock.service
Normal file
13
servicefiles/openhamclock.service
Normal 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
|
||||||
Reference in New Issue
Block a user