mirror of
https://github.com/3cky/mbusd.git
synced 2024-09-26 03:43:04 +02:00
Fix path to mbusd binary in systemd service file (#27)
This commit is contained in:
parent
650d88a269
commit
cb03e4ac1c
@ -1,12 +1,13 @@
|
|||||||
cmake_minimum_required(VERSION 3.2)
|
cmake_minimum_required(VERSION 3.2)
|
||||||
|
|
||||||
|
project(mbusd VERSION 0.3.1)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/extern_GPL)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/extern_GPL)
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(FindSystemd)
|
include(FindSystemd)
|
||||||
|
|
||||||
project(mbusd VERSION 0.3.0)
|
|
||||||
|
|
||||||
#TODO ISC_Posix, prog_libtool
|
#TODO ISC_Posix, prog_libtool
|
||||||
# single-configuration generator setup
|
# single-configuration generator setup
|
||||||
SET(BASIC_C_FLAGS "-W -pedantic -fno-builtin-log -Wall")
|
SET(BASIC_C_FLAGS "-W -pedantic -fno-builtin-log -Wall")
|
||||||
@ -73,7 +74,7 @@ install(TARGETS mbusd DESTINATION bin)
|
|||||||
|
|
||||||
# aggregate the man page template
|
# aggregate the man page template
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/mbusd.8.in mbusd.8)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/mbusd.8.in mbusd.8)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd.8 DESTINATION share/man/man8)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd.8 DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/man/man8)
|
||||||
|
|
||||||
# install example configuration file
|
# install example configuration file
|
||||||
install(
|
install(
|
||||||
@ -85,7 +86,7 @@ if(SYSTEMD_FOUND)
|
|||||||
message(STATUS "Systemd service file will be installed to ${SYSTEMD_SERVICES_INSTALL_DIR}")
|
message(STATUS "Systemd service file will be installed to ${SYSTEMD_SERVICES_INSTALL_DIR}")
|
||||||
# aggregate mbusd@.service from its template
|
# aggregate mbusd@.service from its template
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/systemd-units/mbusd@.service.in mbusd@.service)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/systemd-units/mbusd@.service.in mbusd@.service)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd@.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR})
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd@.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# uninstall target
|
# uninstall target
|
||||||
@ -140,4 +141,9 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
|||||||
set(CPACK_SOURCE_STRIP_FILES TRUE)
|
set(CPACK_SOURCE_STRIP_FILES TRUE)
|
||||||
set(CPACK_STRIP_FILES TRUE)
|
set(CPACK_STRIP_FILES TRUE)
|
||||||
#the include must be after all the cpack concerning set's
|
#the include must be after all the cpack concerning set's
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
||||||
|
message(STATUS "Install prefix ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
message(STATUS "Install bindir: ${CMAKE_INSTALL_FULL_BINDIR}")
|
||||||
|
message(STATUS "Install sysconfdir: ${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
||||||
|
message(STATUS "Install datadir: ${CMAKE_INSTALL_FULL_DATADIR}")
|
||||||
|
@ -36,7 +36,7 @@ Installation instructions:
|
|||||||
$ git clone https://github.com/3cky/mbusd.git mbusd.git
|
$ git clone https://github.com/3cky/mbusd.git mbusd.git
|
||||||
$ cd mbusd.git
|
$ cd mbusd.git
|
||||||
$ mkdir -p build && cd build
|
$ mkdir -p build && cd build
|
||||||
$ cmake ../
|
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
|
||||||
$ make
|
$ make
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
```
|
```
|
||||||
|
@ -3,7 +3,7 @@ Description=Modbus TCP to Modbus RTU (RS-232/485) gateway.
|
|||||||
Requires=network.target
|
Requires=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/mbusd -d -v2 -L - -c /etc/mbusd/mbusd-%i.conf -p /dev/%i
|
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/mbusd -d -v2 -L - -c @CMAKE_INSTALL_FULL_SYSCONFDIR@/mbusd/mbusd-%i.conf -p /dev/%i
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
|
Loading…
Reference in New Issue
Block a user