Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
38256ac
Adding new separate init.d scripts
fozzmoo Oct 2, 2014
54d1c8d
xmlrpcd should die with myexit()
fozzmoo Oct 2, 2014
9c5dcba
daemon_run should call myexit() before returning to clean up gracefully
fozzmoo Oct 3, 2014
c507516
More init scripts and inclusion of them in the root Makefile
fozzmoo Oct 6, 2014
35f2900
New init scripts, some service tweaks, and Makefile changes to suppor…
fozzmoo Oct 9, 2014
78f9714
Added freeside-selfservice-server init bits to Makefile
fozzmoo Oct 9, 2014
9133981
Fixed some shell issues within the install-init target
fozzmoo Oct 15, 2014
dda82f8
Removed old init.d/freeside script and added Debian-style install for…
fozzmoo Oct 15, 2014
52d583a
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
fozzmoo Nov 24, 2014
2c58103
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
fozzmoo Dec 2, 2014
dca2be7
Removed RedHat-specific paths. Added variables for lockfile and pidfile
fozzmoo Dec 5, 2014
2401f19
optimize once_percust condition
ivanfreeside Nov 20, 2014
3c30663
optimize
ivanfreeside Nov 20, 2014
e1b4323
optimize
ivanfreeside Nov 20, 2014
f4b884b
optimize
ivanfreeside Nov 20, 2014
1efc723
optimize
ivanfreeside Nov 20, 2014
643d77f
optimize
ivanfreeside Nov 20, 2014
937f9a5
optimize
ivanfreeside Nov 20, 2014
86c7706
Ticket 29048 add accountcodes to cx3 format
freesidejeremy Nov 28, 2014
7d29b3a
when address standardization returns a censustract, don't try to look…
Dec 2, 2014
019979c
fix censustract lookup for new FFIEC interface, #32459
Dec 3, 2014
2b9de94
Ticket #31495 Earthlink CDR
freesidejeremy Dec 3, 2014
719a5cb
Ticket #32088 Thinktel integration
freesidejeremy Dec 4, 2014
7812b67
Ticket #32382 Vss format fixes
freesidejeremy Nov 27, 2014
120092c
html nits
ivanfreeside Dec 4, 2014
3d8d5b9
contact reports
ivanfreeside Dec 4, 2014
e74b6ed
fix invoice sorting by package category, RT#31272
ivanfreeside Dec 4, 2014
6f5de2c
html nits
ivanfreeside Dec 4, 2014
e9968f2
eliminiate spurious warnings: Argument "" isn't numeric in addition (+)
ivanfreeside Dec 4, 2014
c5a36fc
fix census tract format, #32499, etc.
Dec 4, 2014
bd3255b
backdate credits, RT#32320
ivanfreeside Dec 4, 2014
3e931f2
fix to be how we always search for un-disabled things, RT#32230
ivanfreeside Dec 5, 2014
6059c34
Fix incorrectly uploaded code for vss 32382
freesidejeremy Dec 5, 2014
6331777
fix invoice viewing
ivanfreeside Dec 5, 2014
3491239
Modifications to Makefile and init scripts detailed in previous commi…
fozzmoo Dec 5, 2014
98939d7
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
fozzmoo Dec 5, 2014
5985dc6
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
fozzmoo Dec 8, 2014
a991a68
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
fozzmoo Dec 15, 2014
68a4a8e
Consolidated init.d scripts into a template. Added code to Makefile to
fozzmoo Dec 16, 2014
675c9ac
fix "too much recursion" calendar javascript error
ivanfreeside Dec 16, 2014
554bbec
Debian packages 2916 missing texmf
freesidejeremy Dec 15, 2014
f3bbc6c
fix time in payment and credit back-dating, RT#32320
ivanfreeside Dec 16, 2014
47ab01c
Ticket 29048 3CX CDR format changes
freesidejeremy Dec 16, 2014
b82cb3b
Ticket 31993 different trans codes for business and personal
freesidejeremy Dec 16, 2014
ae0d0e9
Fixed typos in freeside-service.init.in and Makefile
fozzmoo Dec 16, 2014
9072c96
Merge branch 'master' of github.com:freeside/Freeside into Proj42404
fozzmoo Dec 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FS/FS/Daemon/Preforking.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ sub daemon_run {

server_spawn(MAX_PROCESSES);
POE::Kernel->run();
myexit();
#exit;

}
Expand Down
6 changes: 4 additions & 2 deletions FS/bin/freeside-cdrd
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ logfile( "%%%FREESIDE_LOG%%%/cdrd-log.". $FS::UID::datasrc );

daemonize2();

die "not running; no voip_cdr package defs w/ bill_every_call and customer pkgs"
unless _shouldrun();
do {
warn "not running; no voip_cdr package defs w/ bill_every_call and customer pkgs"
myexit();
} unless _shouldrun();

#--

Expand Down
6 changes: 4 additions & 2 deletions FS/bin/freeside-cdrrated
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ daemonize2();

our $conf = new FS::Conf;

die "not running; cdr-prerate conf option is off\n"
unless _shouldrun();
do {
warn "not running; cdr-prerate conf option is off\n"
myexit();
} unless _shouldrun();

#--

Expand Down
8 changes: 5 additions & 3 deletions FS/bin/freeside-cdrrewrited
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ daemonize2();

$conf = new FS::Conf;

die "not running; cdr-asterisk_forward_rewrite, cdr-charged_party_rewrite ".
" and cdr-taqua-accountcode_rewrite conf options are all off\n"
unless _shouldrun();
do {
warn "not running; cdr-asterisk_forward_rewrite, cdr-charged_party_rewrite ".
" and cdr-taqua-accountcode_rewrite conf options are all off\n";
myexit();
} unless _shouldrun();

#--

Expand Down
7 changes: 5 additions & 2 deletions FS/bin/freeside-selfservice-xmlrpcd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl

use FS::Daemon::Preforking qw( freeside_init1 freeside_init2 daemon_run );
use FS::Daemon qw( myexit );

use FS::XMLRPC_Lite; #XMLRPC::Lite for XMLRPC::Serializer
#and XMLRPC::Transport::HTTP
Expand All @@ -26,8 +27,10 @@ freeside_init2(ME);
FS::ClientAPI::Signup::clear_cache();

my $conf = new FS::Conf;
die "not running; selfservice-xmlrpc conf option is off\n"
unless $conf->exists('selfservice-xmlrpc');
do {
warn "not running; selfservice-xmlrpc conf option is off\n"
myexit();
} unless $conf->exists('selfservice-xmlrpc');

daemon_run( 'port' => 8080, 'handle_request' =>
sub {
Expand Down
10 changes: 6 additions & 4 deletions FS/bin/freeside-sqlradius-radacctd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use vars qw( @part_export );
use subs qw(myshutdown);
use POSIX qw(:sys_wait_h);
#use IO::File;
use FS::Daemon qw(daemonize1 drop_root logfile daemonize2 sigint sigterm);
use FS::Daemon qw(daemonize1 drop_root logfile daemonize2 sigint sigterm myexit);
use FS::UID qw(adminsuidsetup); #forksuidsetup driver_name dbh myconnect);
use FS::Record qw(qsearch); # qsearchs);
use FS::part_export;
Expand All @@ -32,9 +32,11 @@ daemonize2();

my @part_export = FS::part_export::sqlradius->all_sqlradius_withaccounting();

die "no sqlradius, sqlradius_withdomain, radiator or phone_sqlradius exports".
do {
warn "no sqlradius, sqlradius_withdomain, radiator or phone_sqlradius exports".
" without ignore_accounting"
unless @part_export;
myexit();
} unless @part_export;

while (1) {

Expand Down Expand Up @@ -89,7 +91,7 @@ sub myshutdown {
&reap_kids;
}
warn "abandoning children" if grep $_->{'_radacct_kid'}, @part_export;
die "exiting";
myexit();
}

sub reap_kids {
Expand Down
6 changes: 4 additions & 2 deletions FS/bin/freeside-torrus-srvderive
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ daemonize2();

our $conf = new FS::Conf;

die "not running: network_monitoring_system not Torrus_Internal\n"
unless _shouldrun();
do {
warn "not running: network_monitoring_system not Torrus_Internal\n"
myexit();
} unless _shouldrun();

#--

Expand Down
14 changes: 10 additions & 4 deletions FS/bin/freeside-xmlrpcd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/perl

use FS::Daemon::Preforking qw( freeside_init1 freeside_init2 daemon_run );
use FS::Daemon qw( myexit );

use FS::XMLRPC_Lite; #XMLRPC::Lite for XMLRPC::Serializer
#and XMLRPC::Transport::HTTP
Expand All @@ -20,10 +21,15 @@ freeside_init1(ME);
freeside_init2(ME);

my $conf = new FS::Conf;
die "not running; xmlrpc_api conf option is off\n"
unless $conf->exists('xmlrpc_api');
die "not running; api_shared_secret conf option is not set\n"
unless $conf->config('api_shared_secret');
do {
warn "not running; xmlrpc_api conf option is off";
myexit();
} unless $conf->exists('xmlrpc_api');

do {
warn "not running; api_shared_secret conf option is not set";
myexit();
} unless $conf->config('api_shared_secret');

daemon_run( 'port' => 8008, 'handle_request' =>
sub {
Expand Down
151 changes: 137 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,53 @@ FREESIDE_DOCUMENT_ROOT = /var/www/freeside
#apache
#FREESIDE_DOCUMENT_ROOT = /usr/local/apache/htdocs/freeside


# /etc/default/freeside on Debian/Ubuntu
FREESIDE_DEFAULTS = /etc/sysconfig/freeside
FREESIDE_BIN = /usr/bin
LOCKFILE_DIR = /var/lock/subsys
PIDFILE_DIR = /var/run

#deb, redhat, fedora, mandrake, suse, others?
INIT_FILE = /etc/init.d/freeside
INIT_FILE_QUEUED = /etc/init.d/freeside-queued
INIT_FILE_PREPAIDD = /etc/init.d/freeside-prepaidd
INIT_FILE_XMLRPCD = /etc/init.d/freeside-xmlrpcd
INIT_FILE_CDRREWRITED = /etc/init.d/freeside-cdrrewrited
INIT_FILE_CDRD = /etc/init.d/freeside-cdrd
INIT_FILE_CDRRATED = /etc/init.d/freeside-cdrrated
INIT_FILE_TORRUS_SRVDERIVE = /etc/init.d/freeside-torrus-srvderive
INIT_FILE_SQLRADIUS_RADACCTD = /etc/init.d/freeside-sqlradius-radacctd
INIT_FILE_TORRUS = /etc/init.d/freeside-torrus
INIT_FILE_SELFSERVICE_XMLRPCD = /etc/init.d/freeside-selfservice-xmlrpcd
INIT_FILE_SELFSERVICE_SERVER = /etc/init.d/freeside-selfservice-server
INIT_FILE_FUNCTIONS = /etc/init.d/freeside-functions
#freebsd
#INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh

#deb
INIT_INSTALL = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside defaults 23 01
#INIT_INSTALL = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside defaults 23 01
#redhat, fedora
#INIT_INSTALL = /sbin/chkconfig freeside on
# INIT_INSTALL_QUEUED = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-queued defaults 23 01
INIT_INSTALL_QUEUED = /sbin/chkconfig freeside-queued on
# INIT_INSTALL_PREPAIDD = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-prepaidd defaults 23 01
INIT_INSTALL_PREPAIDD = /sbin/chkconfig freeside-prepaidd on
# INIT_INSTALL_XMLRPCD = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-xmlrpcd defaults 23 01
INIT_INSTALL_XMLRPCD = /sbin/chkconfig freeside-xmlrpcd on
# INIT_INSTALL_CDRREWRITED = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-cdrrewrited defaults 23 01
INIT_INSTALL_CDRREWRITED = /sbin/chkconfig freeside-cdrrewrited on
# INIT_INSTALL_CDRD = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-cdrd defaults 23 01
INIT_INSTALL_CDRD = /sbin/chkconfig freeside-cdrd on
# INIT_INSTALL_TORRUS_SRVDERIVE = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-torrus-srvderive defaults 23 01
INIT_INSTALL_TORRUS_SRVDERIVE = /sbin/chkconfig freeside-torrus-srvderive on
# INIT_INSTALL_SQLRADIUS_RADACCTD = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-sqlradius-radacctd defaults 23 01
INIT_INSTALL_SQLRADIUS_RADACCTD = /sbin/chkconfig freeside-sqlradius-radacctd on
# INIT_INSTALL_TORRUS = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-torrus defaults 23 01
INIT_INSTALL_TORRUS = /sbin/chkconfig freeside-torrus on
# INIT_INSTALL_SELFSERVICE_XMLRPCD = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-selfservice-xmlrpcd defaults 23 01
INIT_INSTALL_SELFSERVICE_XMLRPCD = /sbin/chkconfig freeside-selfservice-xmlrpcd on
# INIT_INSTALL_SELFSERVICE_SERVER = PATH=$PATH:/sbin /usr/sbin/update-rc.d freeside-selfservice-server defaults 23 01
INIT_INSTALL_SELFSERVICE_SERVER = /sbin/chkconfig freeside-selfservice-server on

#not necessary (freebsd)
#INIT_INSTALL = /usr/bin/true

Expand All @@ -74,11 +112,11 @@ HTTPD_RESTART = /etc/init.d/apache2 restart
APACHE_CONF = /etc/apache2/conf-available
#deb (3.1+), apache2
#APACHE_CONF = /etc/apache2/conf.d
# RHEL and derivatives
#APACHE_CONF = /etc/httpd/conf.d

INSSERV_OVERRIDE = /etc/insserv/overrides

FREESIDE_RESTART = ${INIT_FILE} restart

#deb, redhat, fedora, mandrake, suse, others?
INSTALLGROUP = root
#freebsd, openbsd
Expand Down Expand Up @@ -267,15 +305,101 @@ install-texmf:
texhash /usr/local/share/texmf

install-init:
#[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_QUEUED}
perl -p -i -e "\
s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
s/%%%API_USER%%%/${API_USER}/g;\
s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
" ${INIT_FILE}
${INIT_INSTALL}
s|%%%SERVICE%%%|freeside-queued|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_QUEUED}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_PREPAIDD}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-prepaidd|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_PREPAIDD}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_XMLRPCD}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-xmlrpcd|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${API_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/freeside/\${SERVICE}.pid|g;\
" ${INIT_FILE_XMLRPCD}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_CDRREWRITED}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-cdrrewrited|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_CDRREWRITED}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_CDRD}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-cdrd|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_CDRREWRITED}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_CDRRATED}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-cdrated|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_CDRRATED}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_SELFSERVICE_XMLRPCD}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-selfservice-xmlrpcd|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${SELFSERVICE_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_SELFSERVICE_XMLRPCD}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_SQLRADIUS_RADACCTD}
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-sqlradius-radacctd|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_SQLRADIUS_RADACCTD}

install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-selfservice-server.init ${INIT_FILE_SELFSERVICE_SERVER}
install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-functions ${INIT_FILE_FUNCTIONS}


if [ ${TORRUS_ENABLED} -eq 1 ]; then \
( install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_TORRUS_SRVDERIVE}; \
install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-service.init.in ${INIT_FILE_TORRUS}; \
perl -p -i -e "\
s|%%%SERVICE%%%|torrus|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} collector --tree=main|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/torrus/collector.main_?.pid|g;\
" ${INIT_FILE_TORRUS}; \
perl -p -i -e "\
s|%%%SERVICE%%%|freeside-torrus-srvderive|g;\
s|%%%STARTCOMMAND%%%|\${SERVICE} \${QUEUED_USER}|g;\
s|%%%PIDFILE%%%|\${PIDFILE_DIR}/\${SERVICE}.pid|g;\
" ${INIT_FILE_TORRUS_SRVDERIVE}; \
$INIT_INSTALL_TORRUS; \
$INIT_INSTALL_TORRUS_SRVDERIVE;\
); fi

perl -p -i -e "\
s|%%%FREESIDE_DEFAULTS%%%|${FREESIDE_DEFAULTS}|g;\
s|%%%FREESIDE_BIN%%%|${FREESIDE_BIN}|g;\
" init.d/freeside-functions

${INIT_INSTALL_QUEUED}
${INIT_INSTALL_PREPAIDD}
${INIT_INSTALL_XMLRPCD}
${INIT_INSTALL_CDRREWRITED}
${INIT_INSTALL_CDRD}
${INIT_INSTALL_CDRRATED}
${INIT_INSTALL_SQLRADIUS_RADACCTD}
${INIT_INSTALL_SELFSERVICE_XMLRPCD}
${INIT_INSTALL_SELFSERVICE_SERVER}

/bin/echo -e "#!/bin/bash\n\nLOCKFILE_DIR=${LOCKFILE_DIR}\nPIDFILE_DIR=${PIDFILE_DIR}" > ${FREESIDE_DEFAULTS}
/bin/echo -e "QUEUED_USER=${QUEUED_USER}\nAPI_USER=${API_USER}" >> ${FREESIDE_DEFAULTS}
/bin/echo -e "SELFSERVICE_USER=${SELFSERVICE_USER}\nSELFSERVICE_MACHINES=${SELFSERVICE_MACHINES}" >> ${FREESIDE_DEFAULTS}

install-apache:
[ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
Expand Down Expand Up @@ -322,7 +446,6 @@ install: install-perl-modules install-docs install-init install-apache install-r

deploy: install
${HTTPD_RESTART}
${FREESIDE_RESTART}

dev: dev-perl-modules dev-docs

Expand Down
Loading