I tried to start my-service on Centos 7 - instance on cloud.
It does not work - shows the error: Unknown lvalue 'After network.target' in section 'Unit'
The same service, with exactly the same service and sh files and permissions works fine on my VirtualBox with the same Centos version.
Running my-portal service as a root user:
`#systemctl start my-portal
[root@xxx# systemctl status my-portal -l
● my-portal.service - My Portal Service
Loaded: loaded (/etc/systemd/system/my-portal.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Mar 29 09:15:30 centos-xxx systemd[1]: my-portal.service failed.
Mar 29 09:18:00 centos-xxx systemd[1]: [/etc/systemd/system/my-portal.service:3] Unknown lvalue 'After network.target' in section 'Unit'
Mar 29 09:18:03 centos-xxx systemd[1]: Starting My Portal Service...
Mar 29 09:18:03 centos-xxx my-portal.sh[20106]: Starting my-portal ...
Mar 29 09:18:03 centos-xxx my-portal.sh[20106]: my-portal started ...
Mar 29 09:18:03 centos-xxx my-portal.sh[20109]: my-portal stoping ...
Mar 29 09:18:03 centos-xxx my-portal.sh[20109]: /usr/local/bin/my-portal.sh: line 22: kill: (20107) - No such process
Mar 29 09:18:03 centos-xxx my-portal.sh[20109]: my-portal stopped ...
Mar 29 09:18:03 centos-xxx systemd[1]: Started my Portal Service.
Mar 29 09:18:10 centos-xxx systemd[1]: [/etc/systemd/system/my-portal.service:3] Unknown lvalue 'After network.target' in section 'Unit'
`
When I run application from terminal it works fine:
java -jar /opt/apps/egp/stage/my-portal/target/my-portal.jar server /opt/apps/egp/stage/my-portal/target/my-portal.yml >> /var/log/egp/my-portal.out
These are my files:
my-portal.service i /etc/systemd/system:
`[Unit]
Description = My Portal Service
After network.target = my-portal.service
I tried to start my-service on Centos 7 - instance on cloud. It does not work - shows the error: Unknown lvalue 'After network.target' in section 'Unit'
The same service, with exactly the same service and sh files and permissions works fine on my VirtualBox with the same Centos version.
Running my-portal service as a root user: `#systemctl start my-portal
[root@xxx# systemctl status my-portal -l ● my-portal.service - My Portal Service Loaded: loaded (/etc/systemd/system/my-portal.service; disabled; vendor preset: disabled) Active: inactive (dead)
Mar 29 09:15:30 centos-xxx systemd[1]: my-portal.service failed. Mar 29 09:18:00 centos-xxx systemd[1]: [/etc/systemd/system/my-portal.service:3] Unknown lvalue 'After network.target' in section 'Unit' Mar 29 09:18:03 centos-xxx systemd[1]: Starting My Portal Service... Mar 29 09:18:03 centos-xxx my-portal.sh[20106]: Starting my-portal ... Mar 29 09:18:03 centos-xxx my-portal.sh[20106]: my-portal started ... Mar 29 09:18:03 centos-xxx my-portal.sh[20109]: my-portal stoping ... Mar 29 09:18:03 centos-xxx my-portal.sh[20109]: /usr/local/bin/my-portal.sh: line 22: kill: (20107) - No such process Mar 29 09:18:03 centos-xxx my-portal.sh[20109]: my-portal stopped ... Mar 29 09:18:03 centos-xxx systemd[1]: Started my Portal Service. Mar 29 09:18:10 centos-xxx systemd[1]: [/etc/systemd/system/my-portal.service:3] Unknown lvalue 'After network.target' in section 'Unit' ` When I run application from terminal it works fine:
java -jar /opt/apps/egp/stage/my-portal/target/my-portal.jar server /opt/apps/egp/stage/my-portal/target/my-portal.yml >> /var/log/egp/my-portal.out
These are my files:
my-portal.service i /etc/systemd/system: `[Unit] Description = My Portal Service After network.target = my-portal.service
[Service] Type = forking ExecStart = /usr/local/bin/my-portal.sh start ExecStop = /usr/local/bin/my-portal.sh stop ExecReload = /usr/local/bin/my-portal.sh reload
[Install] WantedBy=multi-user.target`
my-portal.sh in /usr/local/bin (has all permissions):
# cat /etc/*-release
CentOS Linux release 7.4.1708 (Core).
Thank you.