Config dcm4chee_init_redhat.sh in Centos 7

523 views
Skip to first unread message

acm

unread,
Feb 3, 2016, 3:38:05 PM2/3/16
to dcm4che
Hey there,
I'm trying to set dcm4chee to boot me at the beginning , what happens is that I CENTOS 7 and if dcm4chee_init_redhat.sh /etc/init.d/ copy the file does not work for me , I am not able to set the file to work with systemd , some know how.

thanks!

Funky Koval

unread,
Feb 4, 2016, 4:28:05 PM2/4/16
to dcm4che
Hi,
it's systemd
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/chap-Managing_Services_with_systemd.html
https://ma.ttias.be/enable-disable-service-at-boot-on-centos-7

You should to create file /usr/lib/systemd/system/dcm4chee.service:

[Unit]
Description=dcm4chee
After=YourDatabaseEngine.service

[Service]
ExecStart=/YouDcm4cheeServer/bin/dcm4chee_init_redhat.sh start
ExecStop=/YouDcm4cheeServer/bin/dcm4chee_init_redhat.sh stop

[Install]
WantedBy=multi-user.target

then:
systemctl enable dcm4chee.service

and restart for test

Alvaro G. [Andor]

unread,
Feb 4, 2016, 6:02:18 PM2/4/16
to dcm...@googlegroups.com
Maybe that's a bit recursive, as it's calling the regular init.d services and then the startup scripts, and that may impede (although I'm not sure) systemd to follow correctly the process spawing and closure. Also, inside the [Service] section I would add options to run the pacs as an specific user, something I really recommend.

Also, you have to make sure every file inside your dcm4chee path is owned by the dcm4chee/pacs user. Of course, you have to create that user too :D

Mine is something similar to this:

/usr/lib/systemd/system/dcm4chee.service

[Unit]
Description= PACS Server
After=syslog.target network.target

[Service]
Type=simple
User=pacs
Group=pacs
ExecStart=/dcm4cheepath/bin/run.sh
ExecStop=/dcm4cheepath/bin/shutdown.sh -S

[Install]
Alias=pacs
WantedBy=multi-user.target

El 04/02/16 a las 15:28, Funky Koval escribió:
--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at https://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.

Funky Koval

unread,
Feb 4, 2016, 6:48:18 PM2/4/16
to dcm4che
thanks Alvaro for you example

specific user is set (in my way) in dcm4chee_init_redhat.sh:
#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
JBOSS_USER=${JBOSS_USER:-"PacsUser"}

by the way, one more thing to properly close:
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"$JAVAPTH/java -classpath $JBOSSCP org.jboss.Shutdown --shutdown $ADMIN_USER_OPT $ADMIN_PASS_OPT"}



Reply all
Reply to author
Forward
0 new messages