diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/tools/anope.service.in | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 35dcc6139..c029f9177 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -29,6 +29,14 @@ endforeach() # If not on Windows, generate anoperc and install it along with mydbgen if(NOT WIN32) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + configure_file(${Anope_SOURCE_DIR}/src/tools/anope.service.in ${Anope_BINARY_DIR}/src/tools/anope.service) + install( + PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anope.service + DESTINATION ${BIN_DIR} + ) + endif() + configure_file(${Anope_SOURCE_DIR}/src/tools/anoperc.in ${Anope_BINARY_DIR}/src/tools/anoperc) install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anoperc DESTINATION ${BIN_DIR} diff --git a/src/tools/anope.service.in b/src/tools/anope.service.in new file mode 100644 index 000000000..6fe8f652d --- /dev/null +++ b/src/tools/anope.service.in @@ -0,0 +1,17 @@ +[Unit] +After=network.target +Description=Anope IRC Services +Documentation=https://wiki.anope.org/ +After=network-online.target +Wants=network-online.target + +[Service] +ExecReload=/bin/kill -HUP $MAINPID +ExecStart=@BIN_DIR@/@PROGRAM_NAME@ --nofork +Restart=on-failure +Type=simple +WorkingDirectory=@CMAKE_INSTALL_PREFIX@ + +[Install] +WantedBy=multi-user.target + |