install.sh: fix hang at 'Starting inboxer service' by adding ReadWritePaths and start timeout
- Add ReadWritePaths=/opt/inboxer/data /opt/inboxer/logs to the systemd unit so ProtectSystem=full doesn't block SQLite DB and log file creation - Wrap systemctl start with timeout 30s so the script never hangs forever if the service start job blocks
This commit is contained in:
parent
20e28907de
commit
78af7f7a6a
1 changed files with 5 additions and 2 deletions
|
|
@ -162,6 +162,9 @@ ProtectSystem=full
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
|
||||||
|
# Data and logs directories need write access (overrides ProtectSystem=full)
|
||||||
|
ReadWritePaths=${DATA_DIR} ${LOGS_DIR}
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
UNITEOF
|
UNITEOF
|
||||||
|
|
@ -182,8 +185,8 @@ systemctl daemon-reload
|
||||||
info "Enabling ${SERVICE_NAME} service (starts on boot)..."
|
info "Enabling ${SERVICE_NAME} service (starts on boot)..."
|
||||||
systemctl enable "${SERVICE_NAME}"
|
systemctl enable "${SERVICE_NAME}"
|
||||||
|
|
||||||
info "Starting ${SERVICE_NAME} service..."
|
info "Starting ${SERVICE_NAME} service (with 30s timeout)..."
|
||||||
systemctl start "${SERVICE_NAME}"
|
timeout 30 systemctl start "${SERVICE_NAME}" || warn "'systemctl start ${SERVICE_NAME}' timed out or failed — the service may need manual investigation"
|
||||||
|
|
||||||
# Brief pause so the service can initialise
|
# Brief pause so the service can initialise
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue