Skip to content

Commit

Permalink
systemd integration: Add systemd user service file and upstart override.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunweaver committed Dec 8, 2017
1 parent 699c381 commit ee09fe7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
34 changes: 34 additions & 0 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,40 @@ find_package (GSettings)

add_schema ("org.ayatana.indicator.datetime.gschema.xml")

##
## Systemd Unit File
##

pkg_check_modules(SYSTEMD systemd)
if (${SYSTEMD_FOUND})

pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)
message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir")

set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service")
set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}")
set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in")

# build it
set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}")

# install it
install (FILES "${SYSTEMD_USER_FILE}"
DESTINATION "${SYSTEMD_USER_DIR}")

##
## Upstart systemd override Job File
##

set (UPSTART_SYSTEMD_OVERRIDE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/upstart/systemd-session/upstart")
message (STATUS "${UPSTART_SYSTEMD_OVERRIDE_DIR} is the Upstart override Job File for systemd dir")

install (FILES "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.override"
DESTINATION "${UPSTART_SYSTEMD_OVERRIDE_DIR}")

endif()

##
## Upstart Job File
##
Expand Down
1 change: 1 addition & 0 deletions data/ayatana-indicator-datetime.override
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manual
8 changes: 8 additions & 0 deletions data/ayatana-indicator-datetime.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=Ayatana Indicator Session Service
PartOf=graphical-session.target
After=ayatana-indicators-pre.target

[Service]
ExecStart=@pkglibexecdir@/ayatana-indicator-session-service
Restart=on-failure

0 comments on commit ee09fe7

Please sign in to comment.