Create separate shorewallrc files for Debian systemd and sysvinit

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2015-07-31 14:57:59 -07:00
parent 8bcee0ee01
commit 97881bb683
4 changed files with 34 additions and 9 deletions

View File

@ -102,7 +102,7 @@ if [ -z "$vendor" ]; then
vendor=redhat vendor=redhat
;; ;;
debian|ubuntu) debian|ubuntu)
vendor=debian ls -l /sbin/init |fgrep -q systemd | vendor=debian.systemd | vendor=debian.sysvinit
;; ;;
opensuse) opensuse)
vendor=suse vendor=suse
@ -130,7 +130,7 @@ if [ -z "$vendor" ]; then
*) *)
if [ -f /etc/debian_version ]; then if [ -f /etc/debian_version ]; then
params[HOST]=debian params[HOST]=debian
rcfile=shorewallrc.debian rcfile=shorewallrc.debian.sysvinit
elif [ -f /etc/redhat-release ]; then elif [ -f /etc/redhat-release ]; then
params[HOST]=redhat params[HOST]=redhat
rcfile=shorewallrc.redhat rcfile=shorewallrc.redhat

View File

@ -68,14 +68,16 @@ unless ( defined $vendor ) {
$vendor = 'redhat'; $vendor = 'redhat';
} elsif ( $id eq 'opensuse' ) { } elsif ( $id eq 'opensuse' ) {
$vendor = 'suse'; $vendor = 'suse';
} elsif ( $id eq 'ubuntu' ) { } elsif ( $id eq 'ubuntu' || $id eq 'debian' ) {
$vendor = 'debian'; my $init = `ls -l /sbin/init`;
$vendor = $init =~ /systemd/ ? 'debian.systemd' : 'debian.sysvinit';
} else { } else {
$vendor = $id; $vendor = $id;
} }
} }
$params{HOST} = $vendor; $params{HOST} = $vendor;
$params{HOST} =~ s/\..*//;
} }
if ( defined $vendor ) { if ( defined $vendor ) {
@ -84,7 +86,7 @@ if ( defined $vendor ) {
} else { } else {
if ( -f '/etc/debian_version' ) { if ( -f '/etc/debian_version' ) {
$vendor = 'debian'; $vendor = 'debian';
$rcfilename = 'shorewallrc.debian'; $rcfilename = 'shorewallrc.debian.sysvinit';
} elsif ( -f '/etc/redhat-release' ){ } elsif ( -f '/etc/redhat-release' ){
$vendor = 'redhat'; $vendor = 'redhat';
$rcfilename = 'shorewallrc.redhat'; $rcfilename = 'shorewallrc.redhat';
@ -117,7 +119,7 @@ my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
if ( $vendor eq 'linux' ) { if ( $vendor eq 'linux' ) {
printf "INFO: Creating a generic Linux installation - %s %2d %04d %02d:%02d:%02d\n\n", $abbr[$localtime[4]], $localtime[3], 1900 + $localtime[5] , @localtime[2,1,0];; printf "INFO: Creating a generic Linux installation - %s %2d %04d %02d:%02d:%02d\n\n", $abbr[$localtime[4]], $localtime[3], 1900 + $localtime[5] , @localtime[2,1,0];;
} else { } else {
printf "INFO: Creating a %s-specific installation - %s %2d %04d %02d:%02d:%02d\n\n", $vendor, $abbr[$localtime[4]], $localtime[3], 1900 + $localtime[5] , @localtime[2,1,0];; printf "INFO: Creating a %s-specific installation - %s %2d %04d %02d:%02d:%02d\n\n", $params{HOST}, $abbr[$localtime[4]], $localtime[3], 1900 + $localtime[5] , @localtime[2,1,0];;
} }
open $rcfile, '<', $rcfilename or die "Unable to open $rcfilename for input: $!"; open $rcfile, '<', $rcfilename or die "Unable to open $rcfilename for input: $!";

View File

@ -0,0 +1,24 @@
#
# Debian Shorewall 4.5 rc file
#
BUILD= #Default is to detect the build system
HOST=debian
PREFIX=/usr #Top-level directory for shared files, libraries, etc.
SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl module directory
CONFDIR=/etc #Directory where subsystem configurations are installed
SBINDIR=/sbin #Directory where system administration programs are installed
MANDIR=${PREFIX}/share/man #Directory where manpages are installed.
INITDIR= #Directory where SysV init scripts are installed.
INITFILE= #Name of the product's installed SysV init script
INITSOURCE=init.debian.sh #Name of the distributed file to be installed as the SysV init script
ANNOTATED= #If non-zero, annotated configuration files are installed
SYSCONFFILE=default.debian #Name of the distributed file to be installed in $SYSCONFDIR
SERVICEFILE=shorewall-init.service.debian
#Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed
SERVICEDIR=/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored.

View File

@ -15,10 +15,9 @@ INITFILE=$PRODUCT #Name of the product's installed SysV in
INITSOURCE=init.debian.sh #Name of the distributed file to be installed as the SysV init script INITSOURCE=init.debian.sh #Name of the distributed file to be installed as the SysV init script
ANNOTATED= #If non-zero, annotated configuration files are installed ANNOTATED= #If non-zero, annotated configuration files are installed
SYSCONFFILE=default.debian #Name of the distributed file to be installed in $SYSCONFDIR SYSCONFFILE=default.debian #Name of the distributed file to be installed in $SYSCONFDIR
SERVICEFILE=shorewall-init.service.214.debian SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
#Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed
SERVICEDIR=/lib/systemd/system #Directory where .service files are installed (systems running systemd only) SERVICEDIR= #Directory where .service files are installed (systems running systemd only)
SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored. VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored. VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored.