[systemd-devel] Fail Using 'After=network.target' In A Java-Based Service

Pat McDonough pat.mcdonough at redhat.com
Thu Jul 7 19:39:39 PDT 2011


----- Original Message -----
> I'm trying to create a systemd service for a Java-based service and
> running into a networking error despite using "After=network.target"
> 
> Any suggestions as to which dependencies to use or whether this is
> working as expected?
> 
> The service fails during initial system start (6 times before giving
> up):
> > [root at as7-04 ~]# systemctl --no-pager --failed | grep jboss
> > jboss-as.service loaded failed failed JBoss Application Server Defa
> 
> With the following error [1]:
> > ...
> > ... Exception in thread "main" java.net.UnknownHostException:
> > as7-04: as7-04
> > ...
> 
> I can start it up without issue after the system is up:
> > [root at as7-04 ~]# systemctl start jboss-as.service
> > [root at as7-04 ~]# systemctl --no-pager | grep jboss
> > jboss-as.service loaded active running JBoss Application Server D
> 
> My service [2]:
> > ...
> > After=basic.target
> > After=network.target
> > After=syslog.target
> > ...
> 
> [1] https://gist.github.com/1070805
> [2]
> https://github.com/CheffPJ/jboss-as/blob/linux_init/linux/src/main/resources/lib/systemd/system/jboss-as.service

I updated the config temporarily, so use this URL for the old version referred to in the initial email:

https://github.com/CheffPJ/jboss-as/blob/5d68d2352f985c400fabca7274be5820e318d915/linux/src/main/resources/lib/systemd/system/jboss-as.service

> 
> Thanks in Advance,
> 
> Pat McDonough


More information about the systemd-devel mailing list