Add systemd service file
This commit is contained in:
@@ -30,6 +30,13 @@ configure_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/static/start.html"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/mars-nwe-webui.service.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/mars-nwe-webui.service"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
|
||||
#################################
|
||||
# Compiler Switches
|
||||
##############
|
||||
@@ -79,8 +86,11 @@ install(FILES static/smart_icon.jpg DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECD
|
||||
install(FILES static/smart.jpg DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||
install(FILES static/favicon.ico DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR}/static)
|
||||
|
||||
|
||||
if(WITH_SYSTEMD)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mars-nwe-webui.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR})
|
||||
endif()
|
||||
|
||||
install(TARGETS check_login DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
|
||||
|
||||
install(TARGETS nwwebui DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
||||
|
||||
|
||||
23
mars-nwe-webui.service.cmake
Normal file
23
mars-nwe-webui.service.cmake
Normal file
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=MARS NWE Web UI
|
||||
After=network.target mars-nwe-serv.service
|
||||
Wants=network.target
|
||||
Documentation=man:systemd.service(5)
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=/
|
||||
|
||||
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/nwwebui -c @MARS_NWE_INSTALL_FULL_CONFDIR@/smart.conf
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user