Start systemd services automatically

Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
Juhyung Park
2024-10-17 12:59:49 +09:00
parent 90f3a53f7c
commit 5da9b76577
2 changed files with 12 additions and 16 deletions

View File

@@ -145,19 +145,6 @@ In summary, the `install.sh` script does the following:
* Limits listening host from 0.0.0.0 to 127.0.0.1. If you do not want this to happen (make sure you fully understand the security risks!), comment out the `sed` command in `install.sh`'s "Use 127.0.0.1" part.
## 6. Install systemd services
Because the install script switches to the immich user during installation, you must install systemd services manually:
``` bash
sudo cp immich*.service /etc/systemd/system/
sudo systemctl daemon-reload
for i in immich*.service; do
sudo systemctl enable $i
sudo systemctl start $i
done
```
## Done!
Your Immich installation should be running at 3001 port, listening from localhost (127.0.0.1).

View File

@@ -24,8 +24,17 @@ if [[ "$USER" != "immich" ]]; then
mkdir -p /var/log/immich
chown immich:immich /var/log/immich
echo "Restarting the script as user immich"
exec sudo -u immich $0 $*
echo "Forking the script as user immich"
sudo -u immich $0 $*
echo "Starting systemd services"
cp immich*.service /etc/systemd/system/
systemctl daemon-reload
for i in immich*.service; do
systemctl enable $i
systemctl start $i
done
exit 0
fi
BASEDIR=$(dirname "$0")
@@ -166,5 +175,5 @@ EOF
rm -rf $TMP
echo
echo "Done. Please install the systemd services to start using Immich."
echo "Done."
echo