mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-01 22:02:34 -05:00
many improvements to install docs/procedures
* in markdown files, use code fences rather than indented blocks.
This is harder to screw up (one of them was off by a space so didn't
render properly) and allows me to add info strings.
* uniformly use "useradd" to create the user and group in all three
places (install-manual.md, script-functions.sh, Dockerfile) rather
than addgroup + adduser. Create a full home dir, which I suspect was
the problem in #67. Don't allow customizing group name; it's always
the same as the user.
* install the sqlite3 package so that the "moonfire-nvr sql" command
works properly.
* remove "setup_db" function, which was out of place. Since the
creation of the "moonfire-nvr init" command, this has to happen
after installation of the binary. install.md gives instructions on
this part anyway so remove it from the script.
* give a proper command to create the db dir. It was creating it
within the current directory, not within /var/lib/moonfire-nvr.
Don't bother creating sample directory; "moonfire-nvr config"
will do this.
* when setting owners on a newly created directory, use a single
"install -d" command rather than "mkdir" + "chown".
* address confusion about whether sample file dirs need to be
precreated. (Only when Moonfire NVR doesn't have write permissions
on the parent.)
* always just install the packaged version of ffmpeg rather than
building our own. This has been usable since Debian/Raspbian 9
Stretch; Debian/Raspbian 10 Buster is out now so there's no excuse
for still running Debian/Raspbian 8 Jessie.
* don't chown the UI directory; it can be owned by root as with
the binary.
* in scripts/install.sh, don't enable/start the service yet. It hasn't
been configured.
This commit is contained in:
@@ -67,7 +67,6 @@ fi
|
||||
if [ -d "ui-dist" ]; then
|
||||
sudo mkdir -p "${LIB_DIR}/ui"
|
||||
sudo cp -R ui-dist/. "${LIB_DIR}/ui/"
|
||||
sudo chown -R ${NVR_USER}:${NVR_GROUP} "${LIB_DIR}/ui/"
|
||||
echo_info -x "Server UI installed..."
|
||||
else
|
||||
echo_fatal -x "Server UI failed to build or install..."
|
||||
@@ -114,7 +113,7 @@ Environment=RUST_BACKTRACE=1
|
||||
Type=simple
|
||||
User=${NVR_USER}
|
||||
Nice=-20
|
||||
Restart=on-abnormal
|
||||
Restart=on-failure
|
||||
CPUAccounting=true
|
||||
MemoryAccounting=true
|
||||
BlockIOAccounting=true
|
||||
@@ -123,13 +122,4 @@ BlockIOAccounting=true
|
||||
WantedBy=multi-user.target
|
||||
NVR_EOF
|
||||
|
||||
# Configure and start service
|
||||
#
|
||||
if [ -f "${SERVICE_PATH}" ]; then
|
||||
echo_info -x 'Configuring system daemon...'
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ${SERVICE_NAME}
|
||||
sudo systemctl restart ${SERVICE_NAME}
|
||||
echo_info -x 'Getting system daemon status...'
|
||||
sudo systemctl status ${SERVICE_NAME}
|
||||
fi
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
Reference in New Issue
Block a user