Unable to perform zlogin to a SmartOS zone
[root@gz ~]# zlogin 461026ec-a298-4172-ba14-ca392b13e471
[Connected to zone '461026ec-a298-4172-ba14-ca392b13e471' pts/6]
malloc: Resource temporarily unavailable
ld.so.1: login: fatal: /lib/libc.so.1: Resource temporarily unavailable
[Connection to zone '461026ec-a298-4172-ba14-ca392b13e471' pts/6 closed]
Dmesg says
[root@gz ~]# dmesg
2015-03-13T08:56:29.246047+00:00 gz tmpfs: [ID 518458 kern.warning] WARNING: /zones/461026ec-a298-4172-ba14-ca392b13e471/root/etc/svc/volatile: File system full, swap space limit exceeded
2015-03-13T08:56:51.747916+00:00 gz genunix: [ID 470503 kern.warning] WARNING: Sorry, no swap space to grow stack for pid 14479 (zlogin)
Solution
[root@hcn4 ~]# vmadm update 461026ec-a298-4172-ba14-ca392b13e471 max_swap=4096
Friday, March 13, 2015
Thursday, March 12, 2015
Autenticazione Apache con la carta sanitaria Regione Toscana
E' stata una tribolazione: andare a tentoni richiede del tempo.
Utilizzare questo script https://gist.github.com/3v1n0/e371f58162795e0635f2 che fa quanto scritto nei commenti:
mkdir /var/tmp/certs
./parse-gov-certs.py --output-folder /var/tmp/certs
Qui ci saranno vari certificati di Certification Authority di vari enti italiani usati per firmare i certificati di varie smart card, fra cui quelli utili al nostro scopo.
cd /var/tmp/certs
cat Regione_Toscana_-_CA_Cittadini_Servizi_di_Certificazione_* >> /etc/pki/tls/certs/ca-CNS-bundle.crt
In Apache, aprire il file ssl.conf (per esempio) e nel virtualhost opportuno mettere:
<VirtualHost _default_:443>
...
SSLCACertificateFile /etc/pki/tls/certs/ca-CNS-bundle.crt
...
</VirtualHost>
Non sono riuscito a far funzionare la direttiva SSLCACertificatePath, ovvero indicare una directory dove mettere i certificati scaricati con lo script Python.
E per richiedere la verifica del certificato del client (quindi il browser chiede il PIN della carta e passa il cerificato al server), mettere sempre all'interno della definizione del virtual host, o in qualche direttiva Location o Directory:
SSLVerifyClient require
SSLOptions +ExportCertData +StdEnvVars
SSLVerifyDepth 4
Questa è certamente una configurazione di base.
Il client viene autorizzato semplicemente se il certificato che presenta è stato firmato da una di queste CA.
E' possibile autorizzare le carte in base a specifici attributi definiti con le direttive SSLRequire, e probabilmente configurare una CRL (Certificate Revocation List).
Utilizzare questo script https://gist.github.com/3v1n0/e371f58162795e0635f2 che fa quanto scritto nei commenti:
Get Italian government Certification Authority certificates from used by
by various National Service SmartCards (Carta Nazionale dei Servizi- CNS)
mkdir /var/tmp/certs
./parse-gov-certs.py --output-folder /var/tmp/certs
Qui ci saranno vari certificati di Certification Authority di vari enti italiani usati per firmare i certificati di varie smart card, fra cui quelli utili al nostro scopo.
cd /var/tmp/certs
cat Regione_Toscana_-_CA_Cittadini_Servizi_di_Certificazione_* >> /etc/pki/tls/certs/ca-CNS-bundle.crt
In Apache, aprire il file ssl.conf (per esempio) e nel virtualhost opportuno mettere:
<VirtualHost _default_:443>
...
SSLCACertificateFile /etc/pki/tls/certs/ca-CNS-bundle.crt
...
</VirtualHost>
Non sono riuscito a far funzionare la direttiva SSLCACertificatePath, ovvero indicare una directory dove mettere i certificati scaricati con lo script Python.
E per richiedere la verifica del certificato del client (quindi il browser chiede il PIN della carta e passa il cerificato al server), mettere sempre all'interno della definizione del virtual host, o in qualche direttiva Location o Directory:
SSLVerifyClient require
SSLOptions +ExportCertData +StdEnvVars
SSLVerifyDepth 4
Questa è certamente una configurazione di base.
Il client viene autorizzato semplicemente se il certificato che presenta è stato firmato da una di queste CA.
E' possibile autorizzare le carte in base a specifici attributi definiti con le direttive SSLRequire, e probabilmente configurare una CRL (Certificate Revocation List).
Thursday, March 5, 2015
Installing check_mk agent on a SmartOS global zone
The check_mk agent uses inetd (or xinetd).
On Solaris, and on SmartOS, inetd is a legacy facility.
In addition, on the SmartOS GZ, the stuff configured in the /etc directory doesn't survive to reboots, as you may know.
So, since I already use a method to set the hostname at boot time, as described in this blog https://nickebo.net/creating-a-custom-motd-in-the-smartos-global-zone/, I added a pair of lines in the postboot script.
echo "check_mk 6556/tcp" >> /etc/services
echo "check_mk stream tcp nowait root /usr/sbin/tcpd /opt/custom/bin/check_mk_agent" >> /etc/inet/inetd.conf
inetconv
inetconv -e
Then download the check_mk solaris agent from github and put it in the /opt/custom/bin/ directory.
Obviously, if you don't want to reboot the GZ, but enable the service right now, issue the same commands as above.
Remember to change the MK_LIBDIR and the MK_CONFDIR variables in the /opt/custom/bin/check_mk_agent script in order to use additional plugins or configurations.
On Solaris, and on SmartOS, inetd is a legacy facility.
In addition, on the SmartOS GZ, the stuff configured in the /etc directory doesn't survive to reboots, as you may know.
So, since I already use a method to set the hostname at boot time, as described in this blog https://nickebo.net/creating-a-custom-motd-in-the-smartos-global-zone/, I added a pair of lines in the postboot script.
echo "check_mk 6556/tcp" >> /etc/services
echo "check_mk stream tcp nowait root /usr/sbin/tcpd /opt/custom/bin/check_mk_agent" >> /etc/inet/inetd.conf
inetconv
inetconv -e
Then download the check_mk solaris agent from github and put it in the /opt/custom/bin/ directory.
Obviously, if you don't want to reboot the GZ, but enable the service right now, issue the same commands as above.
Remember to change the MK_LIBDIR and the MK_CONFDIR variables in the /opt/custom/bin/check_mk_agent script in order to use additional plugins or configurations.
Tuesday, February 24, 2015
Nagios NConf, Apache, PHP and systemd
I struggled a bit with NConf on CentOS 7.
Following the NConf example configuration files, in order to perform deployment, the default temporary location is /tmp
So, it was supposed that temporary files goes to /tmp, but no file was here.
The right location is /tmp/systemd-private-<randomchars>/tmp/
So, if you want things to work, select another temp dir: neither /var/tmp is a good place (there is a systemd-private directory)
Thursday, January 29, 2015
How-To: dcm4chee on Ubuntu
This article first appeared in Full Circle Magazine, issue #89.
Disclaimer
Maybe this article is not intended for a wide range of people reading this magazine, as I will describe the installation of a niche software related to the medical and health-care enterprise world. It is not a home software; indeed nobody has a positron emission tomography (PET) facility at home, have they?
Maybe I’m wrong, but reading magazines like this, I have the feeling that Ubuntu, Linux and FOSS in general are mainly perceived, by common people, as something related to or useful for:
So, in this article I will explain how to install dcm4chee on Ubuntu. Maybe, as I said before, no reader of this magazine will have the need or the knowledge to install and understand this software, but if you are a student, or if you know a dentist or a radiological study, maybe you could be inspired by knowing the existence of this software.
DICOM (Digital Imaging and Communications in Medicine) “is a standard for handling, storing, printing, and transmitting information in medical imaging”.
PACS (Picture archiving and communication system) is a medical imaging technology which provides storage of and access to images from multiple modalities.
A modality is a source machine where patient’s images are acquired from, for example, an X-Ray machine or a Magnetic Resonance scanner. Some other actors of a PACS are: servers, storage (NAS, SAN, tapes), printers, viewers, CD/DVD robots, etc.
dcm4chee (http://dcm4che.org/) is a DICOM archive and image manager, that is the server side of a PACS system, the server where medical images (an x-ray, an ultrasound, a magnetic resonance) will be stored, and from which a radiologist will retrieve your examination in order to carry out a medical report.
“The application contains the DICOM, HL7 services and interfaces that are required to provide storage, retrieval, and workflow to a health-care environment”. It is written in Java and is prepackaged and deployed within the JBoss application server. It is open source and licensed under an MPL/GPL/LGPL triple license. There are also a lot of DICOM related tools provided by the same developers and community (called dcm4che toolkit), and some DICOM viewers, like Mayam, Oviyam and Weasis.
If you need help and assistance there is a Google group where a vibrant and nice community will be willing to give you some advice. On the other hand, the wiki lacks a little bit in documentation, that is some pages are dated or are incomplete.
Even if some willing person has packaged dcm4che in a “.deb” package, and even if I’m a lover of package management systems, in this case I feel better if I install this software by hand.
So, let’s see how to install dcm4chee on Ubuntu server 14.04 LTS.
First of all we need to install Java. I’m not sure if dcm4chee works with OpenJDK. And I’m not sure if it works with Java 1.7, so let’s install Oracle Java 1.6, using a PPA repository.
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
We need to accept the license, and so on. dcm4chee needs a database: Postgres, DB2, Oracle, MySQL, etc. If you want to try it without a RDBMS, you can opt for the HSQL package, but let’s install MySQL.
sudo apt-get install mysql-server
Now we need to create a schema and grant all rights to a user.
$ mysql -uroot -p*****
mysql> create schema pacsdb;
mysql> grant all on pacsdb.* to pacs@localhost identified by 'pacs';
mysql> flush privileges;
mysql> \q
Now we need to download JBoss and dcm4chee zip files. Download JBoss 4.2.3.GA (don’t use a newer version!) from
http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip/download
Download the latest release of dcm4chee-mysql, 2.18.0 at time of writing, from
http://sourceforge.net/projects/dcm4che/files/dcm4chee/
Put the zip files in a temporary folder, like /var/tmp/dcminstall and unzip them
sudo apt-get install unzip
unzip dcm4chee-2.18.0-mysql.zip
unzip jboss-4.2.3.GA-jdk6.zip
Since we are on a 64-bit operating system, and the dcm4chee zip file contains a 32-bit version of compression library, we have to download the proper Java Advanced Imaging Image I/O Tools for linux 64-bit from
http://download.java.net/media/jai-imageio/builds/release/1.1/
and replace the Linux version of libclib_jiio.so
wget http://download.java.net/media/jai-imageio/builds/release/1.1/jai_imageio-1_1-lib-linux-amd64.tar.gz
tar xzvf jai_imageio-1_1-lib-linux-amd64.tar.gz
cp /var/tmp/install/jai_imageio-1_1/lib/libclib_jiio.so /var/tmp/install/dcm4chee-2.18.0-mysql/bin/native/libclib_jiio.so
Now we have to copy files from JBoss to Dcm4chee:
cd /var/tmp/install/dcm4chee-2.18.0-mysql/bin/
./install_jboss.sh /var/tmp/install/jboss-4.2.3.GA
Now we have to import the provided SQL file in order to create the database tables and indexes:
cd /var/tmp/install/dcm4chee-2.18.0-mysql/sql/
mysql -upacs -ppacs pacsdb < create.mysql
And now we have to move the dcm4chee directory to a definitive place, like /opt, and then it is useful to create a symbolic link (so, in case of an upgrade, we don’t need to modify any script or anything else pointing to the dcm4chee directory):
cd /
sudo mv /var/tmp/install/dcm4chee-2.18.0-mysql/ /opt/
sudo ln -s /opt/dcm4chee-2.18.0-mysql /opt/dcm4chee
It is a good idea to create a dcm4chee user and change the owner of the installation dir.
useradd dcm4chee
chown -R dcm4chee /opt/dcm4chee-2.18.0-mysql
Now we can try to run dcm4chee in foreground:
su - dcm4chee -c /opt/dcm4chee/bin/run.sh
Using a web browser, connect to http://yourubuntuserver:8080/dcm4chee-web3
The default user is “admin” and the default password is “admin”.
In order to make changes to the default configuration, we need to use the JBoss jmx console http://yourubuntuserver:8080/jmx-console/, and this task could be painful since there are no manuals covering a step-by-step configuration: you have to dig inside the wiki and on the old forum or, as I said before, you can call for help in the mailing list.
Disclaimer
Maybe this article is not intended for a wide range of people reading this magazine, as I will describe the installation of a niche software related to the medical and health-care enterprise world. It is not a home software; indeed nobody has a positron emission tomography (PET) facility at home, have they?
Intro
Maybe I’m wrong, but reading magazines like this, I have the feeling that Ubuntu, Linux and FOSS in general are mainly perceived, by common people, as something related to or useful for:
- a hobby for geeks, computer enthusiasts and programmers
- a free and legal way to achieve, using a PC, day by day personal interests (an alternative to Windows and paid software) and tasks such as:
- multimedia and amusement: games, image editing and video playback
- personal and home income management
- office software
- and for professional use, it seems something strictly related to information technology, like something made by programmers for other programmers or IT staff:
- network tools
- web server and stuff like that
- programming languages and development tools
- anything strictly related to IT, computer science, network and so on
- and at last something related to business
So, in this article I will explain how to install dcm4chee on Ubuntu. Maybe, as I said before, no reader of this magazine will have the need or the knowledge to install and understand this software, but if you are a student, or if you know a dentist or a radiological study, maybe you could be inspired by knowing the existence of this software.
DICOM and PACS
DICOM (Digital Imaging and Communications in Medicine) “is a standard for handling, storing, printing, and transmitting information in medical imaging”.
PACS (Picture archiving and communication system) is a medical imaging technology which provides storage of and access to images from multiple modalities.
A modality is a source machine where patient’s images are acquired from, for example, an X-Ray machine or a Magnetic Resonance scanner. Some other actors of a PACS are: servers, storage (NAS, SAN, tapes), printers, viewers, CD/DVD robots, etc.
dcm4chee (http://dcm4che.org/) is a DICOM archive and image manager, that is the server side of a PACS system, the server where medical images (an x-ray, an ultrasound, a magnetic resonance) will be stored, and from which a radiologist will retrieve your examination in order to carry out a medical report.
“The application contains the DICOM, HL7 services and interfaces that are required to provide storage, retrieval, and workflow to a health-care environment”. It is written in Java and is prepackaged and deployed within the JBoss application server. It is open source and licensed under an MPL/GPL/LGPL triple license. There are also a lot of DICOM related tools provided by the same developers and community (called dcm4che toolkit), and some DICOM viewers, like Mayam, Oviyam and Weasis.
If you need help and assistance there is a Google group where a vibrant and nice community will be willing to give you some advice. On the other hand, the wiki lacks a little bit in documentation, that is some pages are dated or are incomplete.
Let's install it
Even if some willing person has packaged dcm4che in a “.deb” package, and even if I’m a lover of package management systems, in this case I feel better if I install this software by hand.
So, let’s see how to install dcm4chee on Ubuntu server 14.04 LTS.
First of all we need to install Java. I’m not sure if dcm4chee works with OpenJDK. And I’m not sure if it works with Java 1.7, so let’s install Oracle Java 1.6, using a PPA repository.
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
We need to accept the license, and so on. dcm4chee needs a database: Postgres, DB2, Oracle, MySQL, etc. If you want to try it without a RDBMS, you can opt for the HSQL package, but let’s install MySQL.
sudo apt-get install mysql-server
Now we need to create a schema and grant all rights to a user.
$ mysql -uroot -p*****
mysql> create schema pacsdb;
mysql> grant all on pacsdb.* to pacs@localhost identified by 'pacs';
mysql> flush privileges;
mysql> \q
Now we need to download JBoss and dcm4chee zip files. Download JBoss 4.2.3.GA (don’t use a newer version!) from
http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA-jdk6.zip/download
Download the latest release of dcm4chee-mysql, 2.18.0 at time of writing, from
http://sourceforge.net/projects/dcm4che/files/dcm4chee/
Put the zip files in a temporary folder, like /var/tmp/dcminstall and unzip them
sudo apt-get install unzip
unzip dcm4chee-2.18.0-mysql.zip
unzip jboss-4.2.3.GA-jdk6.zip
Since we are on a 64-bit operating system, and the dcm4chee zip file contains a 32-bit version of compression library, we have to download the proper Java Advanced Imaging Image I/O Tools for linux 64-bit from
http://download.java.net/media/jai-imageio/builds/release/1.1/
and replace the Linux version of libclib_jiio.so
wget http://download.java.net/media/jai-imageio/builds/release/1.1/jai_imageio-1_1-lib-linux-amd64.tar.gz
tar xzvf jai_imageio-1_1-lib-linux-amd64.tar.gz
cp /var/tmp/install/jai_imageio-1_1/lib/libclib_jiio.so /var/tmp/install/dcm4chee-2.18.0-mysql/bin/native/libclib_jiio.so
Now we have to copy files from JBoss to Dcm4chee:
cd /var/tmp/install/dcm4chee-2.18.0-mysql/bin/
./install_jboss.sh /var/tmp/install/jboss-4.2.3.GA
Now we have to import the provided SQL file in order to create the database tables and indexes:
cd /var/tmp/install/dcm4chee-2.18.0-mysql/sql/
mysql -upacs -ppacs pacsdb < create.mysql
And now we have to move the dcm4chee directory to a definitive place, like /opt, and then it is useful to create a symbolic link (so, in case of an upgrade, we don’t need to modify any script or anything else pointing to the dcm4chee directory):
cd /
sudo mv /var/tmp/install/dcm4chee-2.18.0-mysql/ /opt/
sudo ln -s /opt/dcm4chee-2.18.0-mysql /opt/dcm4chee
It is a good idea to create a dcm4chee user and change the owner of the installation dir.
useradd dcm4chee
chown -R dcm4chee /opt/dcm4chee-2.18.0-mysql
Now we can try to run dcm4chee in foreground:
su - dcm4chee -c /opt/dcm4chee/bin/run.sh
Using a web browser, connect to http://yourubuntuserver:8080/dcm4chee-web3
The default user is “admin” and the default password is “admin”.
In order to make changes to the default configuration, we need to use the JBoss jmx console http://yourubuntuserver:8080/jmx-console/, and this task could be painful since there are no manuals covering a step-by-step configuration: you have to dig inside the wiki and on the old forum or, as I said before, you can call for help in the mailing list.
More info:
- wiki - http://www.dcm4che.org/confluence/display/proj/The+Project
- mailing list - https://groups.google.com/forum/m/?hl=en#!forum/dcm4che
- discontinued forum - http://forums.dcm4che.org
Thursday, December 4, 2014
CentOS 7, ipv6 and yum
If you need to disable IPv6 on CentOS 7, you can follow this method that you can find on a lot of sites using google:
vi /etc/sysctl.d/
vi /etc/sysctl.d/
disable-ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1Then issue sysctl -pHowever you still try to contact IPv6 addresses, so the solution consists in adding this lineip_resolve=4to
/etc/yum.conf
mysql-workbench issues on Ubuntu 14.10 workarounds
Subscribe to:
Posts (Atom)


