Skip to content

Commit

Permalink
add systemd service files
Browse files Browse the repository at this point in the history
to enable running fluidsynth as user service. Fixes FluidSynth#342
  • Loading branch information
derselbst committed Feb 20, 2018
1 parent f125e8a commit aa3703b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,15 @@ if ( UNIX )
configure_file ( fluidsynth.spec.in
${CMAKE_BINARY_DIR}/fluidsynth.spec IMMEDIATE @ONLY )

if ( DEFINED FLUID_DAEMON_ENV_FILE)
configure_file ( fluidsynth.service.in
${CMAKE_BINARY_DIR}/fluidsynth.service @ONLY )

configure_file ( fluidsynth.conf.in
${CMAKE_BINARY_DIR}/fluidsynth.conf @ONLY )

endif ( DEFINED FLUID_DAEMON_ENV_FILE )

# uninstall custom target
configure_file ( "${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
Expand Down
5 changes: 5 additions & 0 deletions fluidsynth.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Mandatory parameters (uncomment and edit)
#SOUND_FONT=@DEFAULT_SOUNDFONT@

# Additional optional parameters (may be useful, see 'man fluidsynth' for further info)
#OTHER_OPTS='-a alsa -m alsa_seq -r 48000'
13 changes: 13 additions & 0 deletions fluidsynth.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=FluidSynth Daemon
Documentation=man:fluidsynth(1)
After=sound.target

[Service]
EnvironmentFile=@FLUID_DAEMON_ENV_FILE@
EnvironmentFile=-%h/.config/fluidsynth
ExecStart=@CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/fluidsynth -is $OTHER_OPTS $SOUND_FONT

[Install]
WantedBy=multi-user.target

0 comments on commit aa3703b

Please sign in to comment.