-
-
Notifications
You must be signed in to change notification settings - Fork 365
Ubuntu24 installer: Updates to installer service #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+44
−23
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a979a80
Updates to installer service
ingoratsdorf 75e1799
updates
ingoratsdorf d13ca83
Fixes
ingoratsdorf eb170a0
Deleted api and log creation from install script
ingoratsdorf e1dd23c
Update install/ubuntu24/install.sh
ingoratsdorf d486018
Update install/ubuntu24/netalertx.service
ingoratsdorf de07fa2
Update install/ubuntu24/pre-start.sh
ingoratsdorf 7e3381b
Update install/ubuntu24/pre-start.sh
ingoratsdorf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # 🛑 Important: This is only used for the bare-metal install 🛑 | ||
|
|
||
| source /etc/default/netalertx | ||
|
|
||
| if [ -z "${INSTALL_DIR}" ]; then | ||
| echo "[NetAlertX Pre-Start] INSTALL_DIR Variable is not defined or is empty." | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
||
| # unmounting in case already mounted | ||
| umount "${INSTALL_DIR}/log" 2>/dev/null | ||
| umount "${INSTALL_DIR}/api" 2>/dev/null | ||
|
|
||
| rm -rf "${INSTALL_DIR}"/log/* "${INSTALL_DIR}"/api/* 2>/dev/null | ||
|
|
||
| mkdir -p "${INSTALL_DIR}/log" "${INSTALL_DIR}/api" | ||
|
|
||
| mount -t tmpfs -o noexec,nosuid,nodev tmpfs "${INSTALL_DIR}/log" || { | ||
| echo "[NetAlertX Pre-Start] Failed to mount tmpfs at ${INSTALL_DIR}/log" | ||
| exit 1 | ||
| } | ||
| mount -t tmpfs -o noexec,nosuid,nodev tmpfs "${INSTALL_DIR}/api" || { | ||
| echo "[NetAlertX Pre-Start] Failed to mount tmpfs at ${INSTALL_DIR}/api" | ||
| exit 1 | ||
| } | ||
|
|
||
|
|
||
| # Create log files if they don't exist | ||
| touch "${INSTALL_DIR}"/log/{app.log,execution_queue.log,app_front.log,app.php_errors.log,stderr.log,stdout.log,db_is_locked.log} | ||
| touch "${INSTALL_DIR}"/api/user_notifications.json | ||
| # Create plugins sub-directory if it doesn't exist in case a custom log folder is used | ||
| mkdir -p "${INSTALL_DIR}"/log/plugins | ||
|
|
||
|
|
||
| chgrp -R www-data "${INSTALL_DIR}/log" "${INSTALL_DIR}/api" | ||
| chmod -R u+rwx,g+rwx,o=rx "${INSTALL_DIR}/api" | ||
| chmod -R u+rwX,g+rwX,o=rX "${INSTALL_DIR}/log" |
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Pre-start move looks good; verify systemd variable expansion and env wiring.
Ensure netalertx.service either:
/usr/bin/bash -lc '<cmd>'(or-c) withEnvironmentFile=/etc/default/netalertxso${INSTALLER_DIR}expands. PlainExecStartPre=/usr/bin/bash ${INSTALLER_DIR}/pre-start.shwon’t expand${…}under systemd.Run:
🏁 Script executed:
Length of output: 1252
Fix
ExecStartPrein netalertx.service to expand${INSTALLER_DIR}In install/ubuntu24/netalertx.service, replace
with
so the shell expands the environment variable before running the script.
🤖 Prompt for AI Agents