VMware Workstation Pro 16: systemd fails to enable unit.

Greetings.

During the installation of the VMware Workstation Pro 16 a ‘vmware’ script placed into the /etc/init.d directory.
It is used to manage additional VMware services.

I’ve created systemd unit file:


[Unit]
Description=VMware Service Startup

[Service]
Type=forking
ExecStart=/bin/bash -c "/etc/init.d/vmware start"
ExecStop=/bin/bash -c "/etc/init.d/vmware stop"

[Install]
WantedBy=default.target

It works when I start/stop the service.
However, when I try to enable service with systemctl enable there is an error:


Synchronizing state of vmware.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable vmware
error: malformated LSB header in vmware: missing LSB end marker, aborting.

Please, advise.

I am not sure, but the fact that you still have scripts in int.d might confuse systemd, because systemd also looks there to see if it must emulate old SysVinit actions.

Could you please suggest a proper location for such script?
**/etc/init.d **is what VMware installer suggests.

This is not the Virtualization sub-forum and I do not know what VMware users think about this.
I would think that VMware nowadays should offer a systemd solution for things like starting a daemon.

And do not forget that my post above was only a suggestion. It is because I was amazed that /etc/init.d is still used for something.

I use Workstation Pro with Leap 15.x only and have no deeper TUMBLEWEED knowledge but you could place the vmware init script to any location you want.
For example you could use /etc/vmware/init.d


# mkdir /etc/vmware/init.d/
# cp -p /etc/init.d/vmware /etc/vmware/init.d/
# rm -f /etc/init.d/vmware

then change INITSCRIPTDIR in file /etc/vmware/bootstrap to the new location


PREFIX="/usr" 
BINDIR="/usr/bin" 
SBINDIR="/usr/sbin" 
LIBDIR="/usr/lib" 
DATADIR="/usr/share" 
SYSCONFDIR="/etc" 
DOCDIR="/usr/share/doc" 
MANDIR="/usr/share/man" 
INCLUDEDIR="/usr/include" 
INITDIR="/etc/init.d" 
**INITSCRIPTDIR="/etc/vmware/init.d"**

and adjust the ExecS* lines in your unit file to the new location. As far as i know the the systemd-sysv-generator is still active in TUMBLEWEED. If the vmware script is in /ect/init.d it will still generate a unit on the fly to /var/run/systemd/generator.late and this leads to the confusing output when you try to enable your own service. On a Leap 15.3 system the VMWare installer does create a second SysV-Init script vmware-USBArbitrator I do not know if this does exists on TUMBLEWEED too. If so you may need to create a second service.

Sorry i am a little to tired today of course you should change INITDIR to the new location too.

@Alexound, from Install VMWare on OpenSUSE Tumbleweed - #3 by sani,