Solved Failed to execute operation: Bad message (systemctl enable glassfish)

Solved issue
Joined
Apr 16, 2023
Messages
149
Reaction score
16
Credits
1,460
Bash:
[root@localhost ~]# systemctl enable glassfish
Failed to execute operation: Bad message
[root@localhost ~]# sudo systemctl enable glassfish
Failed to execute operation: Bad message

How do I fix this issue?

This is my unit file for glassfish.service. I've tried with 2 different such files yet no good.

Bash:
[Unit]
Description = GlassFish Server v4.1
After = syslog.targetnetwork.target
[Service]
User=banksmart
Group=banksmart
ExecStart = /home/banksmart/.java/bin/java -jar
/home/banksmart/glassfish4/glassfish/lib/client/appserver-cli.jar start-domain
ExecStop =/home/banksmart/.java/bin/java -jar
/home/banksmart/glassfish4/glassfish/lib/client/appserver-cli.jar stop-domain
ExecReload =/home/banksmart/.java/bin/java -jar
/home/banksmart/glassfish4/glassfish/lib/client/appserver-cli.jar restart-domain
Type = forking
[Install]
WantedBy = multi-user.target

Bash:
[Unit]
Description = GlassFish Server v4.1
After = syslog.targetnetwork.target
[Service]
User=banksmart
Group=banksmart
ExecStart = /home/banksmart/.java/bin/java -jar
/home/banksmart/glassfish4.1/glassfish4.1/glassfish/lib/client/appserver-cli.jar start-domain
ExecStop =/home/banksmart/.java/bin/java -jar
/home/banksmart/glassfish4.1/glassfish4.1/glassfish/lib/client/appserver-cli.jar stop-domain
ExecReload =/home/banksmart/.java/bin/java -jar
/home/banksmart/glassfish4.1/glassfish4.1/glassfish/lib/client/appserver-cli.jar restart-domain
Type = forking
[Install]
WantedBy = multi-user.target

My appserver-cli.jar is actually located at:
Bash:
/home/banksmart/glassfish4/glassfish/lib/client/appserver-cli.jar

BTW, I am on centos 7 virtual machine.

This is what systemctl status glassfish produces:

Bash:
glassfish.service - GlassFish Server v4.1
   Loaded: error (Reason: Bad message)
   Active: inactive (dead)

Apr 24 23:59:46 localhost.localdomain systemd[1]: [/etc/systemd/system/glassfish.service:8] Missing '='.
Apr 25 00:00:47 localhost.localdomain systemd[1]: [/etc/systemd/system/glassfish.service:8] Missing '='.
Apr 25 00:08:41 localhost.localdomain systemd[1]: [/etc/systemd/system/glassfish.service:8] Missing '='.
Apr 25 00:08:52 localhost.localdomain systemd[1]: [/etc/systemd/system/glassfish.service:8] Missing '='.
Apr 25 00:10:17 localhost.localdomain systemd[1]: [/etc/systemd/system/glassfish.service:8] Missing '='.
 


Why did you start a new topic while you already have one here? My first guess would be that it is running into selinux blocking something since you are start a jar file from your homedir. Where did you actually place glassfish.service, just to see if it's selinux can you try temporarily disabling selinux by running "setenforce 0" and then trying to start the service again?
 
Last edited:
This is a different issue I think. I fixed it. At line 8, there was some issue as the log says. Putting 7 and 8 on same line fixed the issue for me.
 
It would have been useful to have noted that in your OP in this topic because it's confusing since it's still about the same application you are running into a problem with.
 
If that solution is sustained, you can mark both Threads as Solved.

Just go to your first post in each, choose Edit Thread and click No Prefix and choose Solved.

Chris Turner
wizardfromoz
 
Discord is beyond my paygrade, someone else may have an answer.
 

Members online


Top