Source: activemq Version: 5.15.11-1 Severity: normal Dear Maintainer,
Please consider providing a native systemd service masking the activemq init script (fixes lintian tag in subject). I tried my best with what I could come up with by just looking at how the init script currently seem to work. My completely untested service file will be attached. (I don't personally use activemq.) Hopefully it can be a useful starting point for you. Please don't hesitate to reach out for help, I'll happily help out with improvements if you provide the testing and review. (README.Debian section "Setup a new ActiveMQ instance" likely also needs tweaking a bit.) Additionally to the template unit, something will need to enable the actual instances. I suggest you do a one-time convertion in the maintainer scripts (postinst) when upgrading to the new (first) version that ships a native systemd unit (and enable the "main" instance on new installs only). Finally symlink activemq.service to /dev/null to mask the init script as the templated instances will not do so automatically. Additional comments on your init script: - Please, please, please get rid of the NO_START anti-pattern, see https://lintian.debian.org/tags/init.d-script-should-always-start-service.html - Many small improvements can be made, like making `sed 's@.pid@@'` more explicit my matching on end of string, eg. `sed 's@.pid@@'`. You could also try using find with options like -type f or -type d and -maxdepth 1 as a replacement for ls and simplify your scripting. Regards, Andreas Henriksson
[Unit] Description=Apache ActiveMQ After=network.target [Service] Type=forking PIDFile=/run/activemq/%I.pid RuntimeDirectory=activemq Environment=INSTANCE=%I Environment=ACTIVEMQ_BASE=/var/lib/activemq/%I Environment=ACTIVEMQ_PIDFILE=/run/activemq/%I.pid Environment=ACTIVEMQ_CONFIG_DIR=/etc/activemq/instances-enabled/%I WorkingDirectory=/usr/share/activemq # Upstreams "DAEMON" binary is really an init script. # (Note: the debian init script explicitly sources (activemq-)options # files, but the DAEMON script will do that itself. Since it might need # variable expansion we can't replace it with EnvironmentFile=...) ExecStart=/usr/bin/activemq start ExecStop=/usr/bin/activemq stop Restart=on-failure User=activemq Group=activemq [Install] WantedBy=multi-user.target