Skip to content

Commit

Permalink
iRODS 4.3: basic logging implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
stsnel committed Nov 30, 2023
1 parent 547488e commit 275f70c
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 4 deletions.
3 changes: 2 additions & 1 deletion _common/consumer-unattended-install.irods-4.3.template
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"network": "info",
"resource": "info",
"rule_engine": "info",
"server": "info"
"server": "info",
"sql": "info"
},
"match_hash_policy": "compatible",
"negotiation_key": "$NEG_KEY",
Expand Down
12 changes: 11 additions & 1 deletion _common/install-irods-consumer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,21 @@ then echo "Setting up iRODS 4.2 on consumer."
elif [[ "$IRODS_VERSION" =~ ^4\.3\. ]]
then echo "Setting up iRODS 4.3 on consumer."
configure_consumer_4dot3
sudo install -m 0644 -o root -g root /tmp/irods.logrotate /etc/logrotate.d/irods
sudo install -m 0644 -o root -g root /tmp/irods.rsyslog /etc/rsyslog.d/00-irods.conf
sudo mkdir /var/log/irods
sudo chown syslog:adm /var/log/irods
sudo systemctl restart rsyslog.service
else echo "Configuring iRODS version $IRODS_VERSION has not been implemented."
exit 1
fi


# Restart is needed for iRODS 4.2.9+
sudo /etc/init.d/irods restart
if [[ "$IRODS_VERSION" =~ ^4\.2\. ]]
then sudo /etc/init.d/irods restart
else sudo systemctl restart irods
fi


echo "Consumer install script finished."
11 changes: 10 additions & 1 deletion _common/install-irods-provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,19 @@ then echo "Setting up iRODS 4.2 on provider."
elif [[ "$IRODS_VERSION" =~ ^4\.3\. ]]
then echo "Setting up iRODS 4.3 on provider."
configure_provider_4dot3
sudo install -m 0644 -o root -g root /tmp/irods.logrotate /etc/logrotate.d/irods
sudo install -m 0644 -o root -g root /tmp/irods.rsyslog /etc/rsyslog.d/00-irods.conf
sudo mkdir /var/log/irods
sudo chown syslog:adm /var/log/irods
sudo systemctl restart rsyslog.service
else echo "Configuring iRODS version $IRODS_VERSION has not been implemented."
exit 1
fi

# Restart is needed for iRODS 4.2.9+
sudo /etc/init.d/irods restart
if [[ "$IRODS_VERSION" =~ ^4\.2\. ]]
then sudo /etc/init.d/irods restart
else sudo systemctl restart irods
fi

echo "Provider install script finished."
11 changes: 11 additions & 0 deletions _common/irods.logrotate
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/var/log/irods/irods.log {
weekly
rotate 26
copytruncate
delaycompress
compress
dateext
notifempty
missingok
su root root
}
8 changes: 8 additions & 0 deletions _common/irods.rsyslog
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$FileCreateMode 0644
$DirCreateMode 0755
$Umask 0000
$template irods_format,"%msg%\n"
:programname,startswith,"irodsServer" /var/log/irods/irods.log;irods_format
& stop
:programname,startswith,"irodsDelayServer" /var/log/irods/irods.log;irods_format
& stop
3 changes: 2 additions & 1 deletion _common/provider-unattended-install.irods-4.3.template
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"network": "info",
"resource": "info",
"rule_engine": "info",
"server": "info"
"server": "info",
"sql": "info"
},
"match_hash_policy": "compatible",
"negotiation_key": "$NEG_KEY",
Expand Down
4 changes: 4 additions & 0 deletions irods-provider-consumer/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Vagrant.configure("2") do |config|
provider.vm.provision "file", source: ".env", destination: "/tmp/irods-test.env"
provider.vm.provision "file", source: "../_common/common_functions.sh", destination: "/tmp/common_functions.sh"
provider.vm.provision "file", source: "../_common/provider-unattended-install.irods-4.3.template", destination: "/tmp/provider-unattended-install.irods-4.3.template"
provider.vm.provision "file", source: "../_common/irods.rsyslog", destination: "/tmp/irods.rsyslog"
provider.vm.provision "file", source: "../_common/irods.logrotate", destination: "/tmp/irods.logrotate"
provider.vm.provision :shell, :path => '../_common/update-ipv6-settings.sh', :args => "/tmp/irods-test.env"
provider.vm.provision :shell, :path => '../_common/initialize-hosts-file.sh', :args => "/tmp/irods-test.env"
provider.vm.provision :shell, :path => '../_common/initialize-network-settings.sh', :args => "/tmp/irods-test.env"
Expand All @@ -37,6 +39,8 @@ Vagrant.configure("2") do |config|
consumer.vm.provision "file", source: ".env", destination: "/tmp/irods-test.env"
consumer.vm.provision "file", source: "../_common/common_functions.sh", destination: "/tmp/common_functions.sh"
consumer.vm.provision "file", source: "../_common/consumer-unattended-install.irods-4.3.template", destination: "/tmp/consumer-unattended-install.irods-4.3.template"
consumer.vm.provision "file", source: "../_common/irods.rsyslog", destination: "/tmp/irods.rsyslog"
consumer.vm.provision "file", source: "../_common/irods.logrotate", destination: "/tmp/irods.logrotate"
consumer.vm.provision :shell, :path => '../_common/update-ipv6-settings.sh', :args => "/tmp/irods-test.env"
consumer.vm.provision :shell, :path => '../_common/initialize-hosts-file.sh' , :args => "/tmp/irods-test.env"
consumer.vm.provision :shell, :path => '../_common/initialize-network-settings.sh', :args => "/tmp/irods-test.env"
Expand Down
2 changes: 2 additions & 0 deletions irods-single-server/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Vagrant.configure("2") do |config|
provider.vm.provision "file", source: ".env", destination: "/tmp/irods-test.env"
provider.vm.provision "file", source: "../_common/common_functions.sh", destination: "/tmp/common_functions.sh"
provider.vm.provision "file", source: "../_common/provider-unattended-install.irods-4.3.template", destination: "/tmp/provider-unattended-install.irods-4.3.template"
provider.vm.provision "file", source: "../_common/irods.rsyslog", destination: "/tmp/irods.rsyslog"
provider.vm.provision "file", source: "../_common/irods.logrotate", destination: "/tmp/irods.logrotate"
provider.vm.provision :shell, :path => '../_common/update-ipv6-settings.sh', :args => "/tmp/irods-test.env"
provider.vm.provision :shell, :path => '../_common/initialize-network-settings.sh', :args => "/tmp/irods-test.env"
provider.vm.provision :shell, :path => '../_common/install-irods-provider.sh', :args => "/tmp/irods-test.env"
Expand Down

0 comments on commit 275f70c

Please sign in to comment.