I have a java file which I'm trying to install as a service. But I'm getting errors. Below is the contents of my file and errors. I'm running Debian 8.[Unit]Description=App1ManagerAfter=syslog.target[Service]ExecStart=/usr/bin/jsvc -user root -cp /usr/share/java/commons-daemon.jar:/usr/local/myapp/bin/Manager.jar -pidfile /var/run/app1manager.pidType=forking[Install]WantedBy=multi-user.targetWith either the below I get the following error:SYSTEMD_LOG_LEVEL=debug /lib/systemd/system/myapp1 SYSTEMD_LOG_LEVEL=debug /etc/init.d/myapp1 /etc/init.d/myapp1: line 1: [Unit]: command not found/etc/init.d/myapp1: line 6: [Service]: command not found/etc/init.d/myapp1: line 7: -user: command not found/etc/init.d/myapp1: line 10: [Install]: command not foundAug 12 12:04:39 debian systemd[3903]: Failed at step EXEC spawning /etc/init.d/myapp1: Exec format error-- Subject: Process /etc/init.d/myapp1 could not be executed-- Defined-By: systemd-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel---- The process /etc/init.d/myapp1 could not be executed and failed.---- The error number returned while executing this process is 8.Aug 12 12:04:39 debian systemd[1]: myapp1.service: control process exited, code=exited status=203Aug 12 12:04:39 debian systemd[1]: Failed to start (null).-- Subject: Unit myapp1.service has failed-- Defined-By: systemd-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel---- Unit myapp1.service has failed.---- The result is failed.Aug 12 12:04:39 debian systemd[1]: Unit myapp1.service entered failed state.
systemd Exec format error
debian;systemd
Install to systemd/system with a .service file extension; the executable bit does not need to be set.  Do not install systemd-format service files to /etc/init.d/; this is for legacy SysVinit style service scripts.To start services, use systemctl start myapp1.  When you're not sure whether the service is implemented as systemd or SysV, use service myapp1 start.To enable on boot [given an appropriate Install section] use systemctl enable myapp1.