]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8369 Debian8/CentOS7 systemd installer additions
authorNiek Vlessert <niekvlessert@gmail.com>
Tue, 20 Oct 2015 21:21:50 +0000 (23:21 +0200)
committerNiek Vlessert <niekvlessert@gmail.com>
Fri, 30 Oct 2015 18:11:32 +0000 (19:11 +0100)
After builing Freeswitch this makes actually run it easy by offering
an installer script.

* Changes to configure.ac to detect Debian8/CentOS 7 and create installer script
* Changes to build/Makefile.am to display the option
* Added build/startup directory with templates and other files
* Deleted outdated build/freeswitch.service and tmpfiles.conf
* Unit file based on the latest systemd service file FS-8194
* Won't interfere with other platforms (afaik)
* Supports all bindir directory prefixes ./configure can have
* Detects if Debian8/CentOS7 use systemd
* Can be used with a user with sudo permissions

build/Makefile.am
build/startup/freeswitch.default [moved from init/freeswitch.default with 100% similarity]
build/startup/freeswitch.service.in [moved from init/freeswitch.service.in with 100% similarity]
build/startup/freeswitch.tmpfile [moved from init/freeswitch.tmpfile with 100% similarity]
build/startup/install_systemd.sh.in [moved from init/install_systemd.sh.in with 91% similarity]
configure.ac

index 38202826da4fca583cc075a85456d35cacc6c411..dbda77330ed389fee97a9b6c3f9609c3b0154a8e 100644 (file)
@@ -57,10 +57,10 @@ install:
        @echo " +               $(MK) samples                     +"
 if KNOWN_INIT
        @echo " +                                                 +"
-       @echo " +       Install init scripts:                     +"
-       @echo " +       ---------------------                     +"
+       @echo " +       Install startup scripts:                  +"
+       @echo " +       ------------------------                  +"
        @echo " +                                                 +"
-       @echo " +       init/install_systemd.sh                   +"
+       @echo " +       build/startup/install_systemd.sh          +"
 endif
        @echo " +                                                 +"
        @echo " +                                                 +"
similarity index 91%
rename from init/install_systemd.sh.in
rename to build/startup/install_systemd.sh.in
index 60253a141aa99ecbfc7ec2ffe1d5a9553bb2c502..6fe5374a5c24dc4a3cf36a3848fc409abf8a6686 100644 (file)
@@ -25,11 +25,11 @@ echo "- Create user freeswitch and add it to group freeswitch"
 FSPATH=@prefix@
 if [[ $FSPATH == *"freeswitch"* ]]
 then
-       echo "- Set permissions on @prefix@ and files in @bindir@"
+       echo "- Set permissions on @prefix@ and files in @bindir_expanded@"
 fi
 echo "- Install systemd unit file"
 echo "- Install /etc/@environmentfilelocation@/freeswitch"
-echo 
+echo
 read -p "Do you want to continue? (y/n) " -n 1 -r
 if [[ $REPLY =~ ^[yY]$ ]]
 then
@@ -45,7 +45,7 @@ then
        then
                $SUDO chown -R freeswitch:freeswitch @prefix@
                $SUDO chmod -R ug=rwX,o= @prefix@
-               $SUDO chmod -R u=rwx,g=rx @bindir@/*
+               $SUDO chmod -R u=rwx,g=rx @bindir_expanded@/*
        fi
        $SUDO cp init/freeswitch.service /etc/systemd/system/
        $SUDO cp init/freeswitch.tmpfile /etc/tmpfiles.d/freeswitch.conf
@@ -58,5 +58,5 @@ then
        else
                echo "Make sure your config files are in place in @confdir@, if they are you can start Freeswitch using 'systemctl start freeswitch'"
        fi
-       echo "Then start fs_cli by running @bindir@/fs_cli"
+       echo "Then start fs_cli by running @bindir_expanded@/fs_cli"
 fi
index df050a0001cc77772c910f425dd940d628dc6426..a1d8010a397b373ba3c5062788d87eab1a86a89e 100644 (file)
@@ -83,7 +83,7 @@ default_certsdir="$prefix/certs"
 default_fontsdir="$prefix/fonts"
 default_imagesdir="$prefix/images"
 
-bindir="$exec_prefix/bin"
+eval bindir_expanded="${bindir}"
 
 if test "${enable_fhs}" = "yes"; then
     eval full_datadir="${datadir}/freeswitch"
@@ -789,8 +789,9 @@ case "$host" in
                                        AC_SUBST(DISTRO)
                                        AC_SUBST(rundir)
                                        AC_SUBST(environmentfilelocation)
-                                       AC_CONFIG_FILES([init/install_systemd.sh], [chmod +x init/install_systemd.sh])
-                                       AC_CONFIG_FILES([init/freeswitch.service])
+                                       AC_SUBST(bindir_expanded)
+                                       AC_CONFIG_FILES([build/startup/install_systemd.sh], [chmod +x build/startup/install_systemd.sh])
+                                       AC_CONFIG_FILES([build/startup/freeswitch.service])
                                fi
                                ;;
                        *)