X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=693c254fe2978f2021dcdfc07f1cb66ae14aaea9;hb=f5c291366761e8f560f3dc30e65bdf4c2931d807;hp=03b2c5e9393a8153683a4315bcc3da3e173dd63e;hpb=cf0875041dff339d73329a343469d685de7ef62b;p=bacula-cn.git diff --git a/debian/postinst b/debian/postinst index 03b2c5e..693c254 100644 --- a/debian/postinst +++ b/debian/postinst @@ -52,7 +52,7 @@ Director { # directors to verify the authenticity of this file daemon TLS Certificate = "/etc/bacula/bacula-fd.pem" TLS Key = "/etc/bacula/bacula-fd.pem" - TLS DH File = "/etc/bacula/dh1024.pem" + TLS DH File = "/etc/bacula/dh2048.pem" } # @@ -62,8 +62,9 @@ FileDaemon { # this is me Name = $HOST-fd FDport = 9102 # where we listen for the director WorkingDirectory = /var/lib/bacula - Pid Directory = /var/run/bacula + Pid Directory = /run/bacula Maximum Concurrent Jobs = 20 + Plugin Directory = /usr/lib/bacula FDAddress = $IP # you need these TLS entries so the FD and SD can communicate @@ -130,7 +131,7 @@ EOF } generate_dh() { - DH_FILE=/etc/bacula/dh1024.pem + DH_FILE=/etc/bacula/dh2048.pem if [ -s $DH_FILE ]; then echo $DH_FILE already exists, skipping. @@ -138,7 +139,9 @@ generate_dh() { umask 077 echo Generating $DH_FILE - openssl dhparam -out $DH_FILE -5 1024 + ###openssl dhparam -out $DH_FILE -5 1024 + openssl dhparam -out $DH_FILE -2 2048 + fi } @@ -154,7 +157,7 @@ generate_cert() { rm -f $REQUEST_FILE openssl req -new -newkey rsa:2048 -nodes -keyout $CERT_FILE \ -subj "/C=HR/ST=Croatia/O=CARNet/OU=sysbackup/CN=$IP" \ - -x509 -extensions usr_cert -days $((365*5)) \ + -x509 -extensions usr_cert -days $((365*10)) \ -out $CERT_FILE fi } @@ -186,6 +189,10 @@ send_request() { DF_FILE=$(mktemp bacula-cn.XXXXXXXXXX) df -h > $DF_FILE + # dodaj i /media i /mnt + test -d /media && du -hs /media || true >> $DF_FILE + test -d /mnt && du -hs /mnt || true >> $DF_FILE + # report database sizes DB_FILE=$(mktemp bacula-cn.XXXXXXXXXX) if [ -d /var/lib/mysql -o -d /var/lib/postgresql ]; then @@ -251,13 +258,20 @@ EOF # cleanup rm -f $DF_FILE $DB_FILE $FD_FILE $PEM_FILE - # report problems + # report problems if [ ! -e $REQUEST_FILE ]; then db_input high bacula-cn/request-failed || true db_go || true fi } - + +fix_privileges() { + # fix privileges + + chown root:bacula /etc/bacula/bacula-fd.pem /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf + chmod 640 /etc/bacula/bacula-fd.pem /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf +} + load_config() { db_get bacula-cn/hostname HOST=$RET @@ -287,6 +301,8 @@ case "$1" in generate_fd_config generate_bconsole_config + fix_privileges + restart_bacula send_request