mirror of
https://github.com/iio612/immich-native.git
synced 2026-04-17 12:01:05 +00:00
Start systemd services automatically
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
This commit is contained in:
13
README.md
13
README.md
@@ -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.
|
* 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!
|
## Done!
|
||||||
|
|
||||||
Your Immich installation should be running at 3001 port, listening from localhost (127.0.0.1).
|
Your Immich installation should be running at 3001 port, listening from localhost (127.0.0.1).
|
||||||
|
|||||||
15
install.sh
15
install.sh
@@ -24,8 +24,17 @@ if [[ "$USER" != "immich" ]]; then
|
|||||||
mkdir -p /var/log/immich
|
mkdir -p /var/log/immich
|
||||||
chown immich:immich /var/log/immich
|
chown immich:immich /var/log/immich
|
||||||
|
|
||||||
echo "Restarting the script as user immich"
|
echo "Forking the script as user immich"
|
||||||
exec sudo -u immich $0 $*
|
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
|
fi
|
||||||
|
|
||||||
BASEDIR=$(dirname "$0")
|
BASEDIR=$(dirname "$0")
|
||||||
@@ -166,5 +175,5 @@ EOF
|
|||||||
rm -rf $TMP
|
rm -rf $TMP
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Done. Please install the systemd services to start using Immich."
|
echo "Done."
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user