Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No systemd service in Debian packages in master #7189

Closed
patrick-stephens opened this issue Apr 14, 2023 · 2 comments · Fixed by #7193
Closed

No systemd service in Debian packages in master #7189

patrick-stephens opened this issue Apr 14, 2023 · 2 comments · Fixed by #7193

Comments

@patrick-stephens
Copy link
Contributor

Looks like a recent change has removed the systemd service from the Debian packages.

Testing with an Ubuntu 20.04 build and container shows no service installed.

Originally posted by @patrick-stephens in #7050 (comment)

@patrick-stephens
Copy link
Contributor Author

Possibly related to #5818

@patrick-stephens patrick-stephens changed the title No systemd service in Debian packages No systemd service in Debian packages in master Apr 14, 2023
@patrick-stephens
Copy link
Contributor Author

patrick-stephens commented Apr 14, 2023

Yup, this is down to the changes in #5818 - reverting them locally and rebuilding the package shows them included.

$ git diff
diff --git a/cmake/FindJournald.cmake b/cmake/FindJournald.cmake
index 9e6657a29..7be9310bd 100644
--- a/cmake/FindJournald.cmake
+++ b/cmake/FindJournald.cmake
@@ -18,9 +18,9 @@
 # in the FIND_PATH() and FIND_LIBRARY() calls
 find_package(PkgConfig)
 pkg_check_modules(PC_JOURNALD QUIET systemd)
-pkg_get_variable(PC_SYSTEMD_UNITDIR systemd "systemdsystemunitdir")
+# pkg_get_variable(PC_SYSTEMD_UNITDIR systemd "systemdsystemunitdir")
 
-set(SYSTEMD_UNITDIR ${PC_SYSTEMD_UNITDIR})
+# set(SYSTEMD_UNITDIR ${PC_SYSTEMD_UNITDIR})
 set(JOURNALD_FOUND ${PC_JOURNALD_FOUND})
 set(JOURNALD_DEFINITIONS ${PC_JOURNALD_CFLAGS_OTHER})
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f6fd8109c..e0deb584d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -515,13 +515,13 @@ if(FLB_BINARY)
   endif()
 
   # Detect init system, install upstart, systemd or init.d script
-  if(DEFINED SYSTEMD_UNITDIR)
+  if(IS_DIRECTORY /lib/systemd/system)
     set(FLB_SYSTEMD_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.service")
     configure_file(
       "${PROJECT_SOURCE_DIR}/init/systemd.in"
       ${FLB_SYSTEMD_SCRIPT}
       )
-    install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION ${SYSTEMD_UNITDIR})
+    install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION /lib/systemd/system)
     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR} COMPONENT binary)
   elseif(IS_DIRECTORY /usr/share/upstart)
     set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
$ ./packaging/build.sh -d ubuntu/20.04
...
+ echo

+ echo 'Package(s) generated at: /home/pat/github/fluent/fluent-bit/packaging/packages/ubuntu/20.04/2023-04-14-10_44_41/'
Package(s) generated at: /home/pat/github/fluent/fluent-bit/packaging/packages/ubuntu/20.04/2023-04-14-10_44_41/
+ echo

pat@calyptia-laptop:~/github/fluent/fluent-bit$ docker run --rm -it -v /home/pat/github/fluent/fluent-bit/packaging/packages/ubuntu/20.04/2023-04-14-10_44_41:/install:ro ubuntu:20.04
root@913f9babe491:/# apt-get update
...
Fetched 25.9 MB in 9s (2805 kB/s)                                                                                                                                                                         
Reading package lists... Done
root@913f9babe491:/# apt-get install -y /install/fluent-bit_2.1.0_amd64.deb 
Reading package lists... Done
...
root@913f9babe491:/# find / -name 'fluent-bit.service'
/usr/lib/systemd/system/fluent-bit.service

The same test fails from master build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant