From a3d27cb3f7a950d90e5b97cdb3446f157de8ad36 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Wed, 6 Oct 2021 22:41:43 +0200 Subject: [PATCH] data: install systemd system service --- data/eg25-manager.service.in | 21 +++++++++++++++++++++ data/meson.build | 10 ++++++++++ meson.build | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 data/eg25-manager.service.in diff --git a/data/eg25-manager.service.in b/data/eg25-manager.service.in new file mode 100644 index 0000000..fe050c1 --- /dev/null +++ b/data/eg25-manager.service.in @@ -0,0 +1,21 @@ +[Unit] +Description=Quectel EG25 modem +Before=ModemManager.service + +[Service] +Type=simple +ExecStart=@bindir@/eg25manager +Restart=on-failure +ProtectControlGroups=true +ProtectHome=true +ProtectSystem=strict +RestrictSUIDSGID=true +PrivateTmp=true +MemoryDenyWriteExecute=true +PrivateMounts=true +NoNewPrivileges=true +CapabilityBoundingSet= +LockPersonality=true + +[Install] +WantedBy=multi-user.target diff --git a/data/meson.build b/data/meson.build index 30a1c92..56bc6e3 100644 --- a/data/meson.build +++ b/data/meson.build @@ -11,3 +11,13 @@ conf_files = [ ] install_data(conf_files) + +serviceconf = configuration_data() +serviceconf.set('bindir', bindir) +configure_file( + input: 'eg25-manager.service.in', + output: 'eg25-manager.service', + install_dir: systemdsystemdir, + configuration: serviceconf, + install: true +) diff --git a/meson.build b/meson.build index dd90465..512637d 100644 --- a/meson.build +++ b/meson.build @@ -28,6 +28,8 @@ datadir = get_option('datadir') sysconfdir = get_option('sysconfdir') bindir = join_paths(prefix, get_option('bindir')) udevrulesdir = join_paths(prefix, 'lib/udev/rules.d') +systemddir = join_paths(prefix, 'lib/systemd') +systemdsystemdir = join_paths(systemddir, 'system') if datadir.startswith('/') full_datadir = datadir