Set environment variable APP_RESTART_CMD=”/path/to/your_app_script.sh restart”

Infos:

  • Used Zammad version: 5.0x
  • Used Zammad installation type: (source, package, docker-compose, …) I think package
  • Operating system: ubuntu 20
  • Browser + version: latest Firefox

Expected behavior:

  • auto restart of zammad

Actual behavior:

I got a message after removing an object

Zammad need a restart!

Some system settings have changed, please restart all Zammad processes! If you want to do this automatically, set environment variable APP_RESTART_CMD="/path/to/your_app_script.sh restart".

OK so what user do I set this with my initial ubuntu user, root, zammad ???
Do I add the environment variable to a .profile file and again for which user

Steps to reproduce the behavior:

So I do believe that zammad is started via systemctl start zammad but I’m not 100% sure I know I have a stoped and tarted it with systemctl [start|stop|…] zammad and I think the install instruction did mention it

Any how the ticket show

f for example if zammad can be started with systemctl start zammad
You’ll want to look at /etc/systemd/system/zammad.service or if that doesn’t exist /lib/systemd/system/zammad.service

Then see if there’s a line like

EnvironmentFile=-/etc/default/zammad

Then you would put
APP_RESTART_CMD="systemctl restart zammad" # or however you want to restart zammad
in /etc/default/zammad

If that line doesn’t exist you could add the full EnvironmentFile line under [service] and create the /etc/default/zammad file or do whatever other way systemctl has provided to set environment variables.

I haven’t tested any of this, but if systemctl is how you start zammad, then that is where you set the environment variables.

a cat /etc/systemd/system/zammad.service does NOT show a line line EnvironmentFile=-/etc/default/zammad

I do have a file /etc/default/zammad and it does have some variables in it so I guess I should add it there yes/no?

YES YES YES I tried it and it work

I added

export APP_RESTART_CMD=“systemctl restart zammad”

to the file /etc/default/zammad and I add an object, upond clicking the update database I see the message >

Zammad is restarting…

Some system settings have changed, Zammad is restarting. Please wait until Zammad is back again.

I will say it seems like my browser is stuck

sudo systemctl status zammad show

● zammad.service
Loaded: loaded (/etc/systemd/system/zammad.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-03-06 22:18:49 UTC; 9min ago
Main PID: 648 (sleep)
Tasks: 1 (limit: 28754)
Memory: 216.0K
CGroup: /system.slice/zammad.service
└─648 /bin/sleep infinity

Mar 06 22:18:49 gdctickets systemd[1]: Started zammad.service.

so I guess it worked but how do I unstick the browser - A refresh did it but it said Please wait until Zammad is back again so I assumes it would auto refesh, guess not.

Any how glad it worked