We recently setup the new SMB notifications feature available with the Enterprise edition of 9.1, so we thought we would share our experiences for others.
First, you'll need to setup a listener for each of your shares.
Second, in a high availability environment, setup only one listener per share. Consequently, there is no redundancy for the listener(s).
Third, your credentials will be in plain text, which is gross but currently unavoidable.
Finally, we created a systemd script for CentOS 7. It should work on any systemd distro, provided you change the paths/users accordingly.
* Create a owncloud-listener.service file in /etc/systemd/system/ using your favorite text editor.
* Copy the contents from below into the file.
* Make sure the file is owned by root and has permissions 644.
systemctl enable owncloud-listener.service
(or whatever you have named your file in step 1).
- Control your new service like any other, e.g.:
systemctl start owncloud-listener
- This script is configured to autostart on boot.
- Need multiple listeners? Just change the name of the file you create in step 1 and configure the ExecStart parameters accordingly.
[Unit] Description=ownCloud WND Listener After=syslog.target network.target Requires=httpd.service [Service] User=apache Group=apache WorkingDirectory=/var/www/html/owncloud ExecStart=/usr/bin/php /var/www/html/owncloud/occ wnd:listen SERVER SHARE USER PASSWORD Type=simple StandardOutput=journal StandardError=journal SyslogIdentifier=%n KillMode=process RestartSec=1 Restart=on-failure [Install] WantedBy=multi-user.target