We ought to be able to disable SIP with koha-sip --disable inst At minimum, disabling SIP should - Stop running SIP services for that instance - back up the latest existent SIPconfig, and remove the SIPconfig.xml from /etc/koha/sites/inst/ so that it can't start.
Created attachment 96797 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * the SIPconfig.xml file has been moved to SIPconfig.xml.bak * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because of no config.
Another feature that would be neat, but that I probably won't do for this patch, is the ability to re-enable from a backed up config, if it exists. I don't know why someone would want to do that, but we're keeping a backup so why not allow it.
Created attachment 96813 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * the SIPconfig.xml file has been moved to SIPconfig.xml.bak * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because of no config. Signed-off-by: David Nind <david@davidnind.com>
Hi Liz. I've signed this off, but I think the debian/docs/koha-sip.xml file needs updating so that the option is listed in the man page for the package command.
Notes for those testing using koha-testing-docker. After applying the patch the change to the script isn't recognised, and I get an error message when using the disable option: Error: invalid option switch (--disable) I had to restart the environment (CTRL-C, then kd, then ku to bring up a fresh instance) as restart_all and flush_memcached didn't seem to work to recognise the script change. koha-testing-docker has SIP enabled by default so before you test you may want to stop SIP (koha-sip --stop kohadev) and delete the /etc/koha/sites/kohadev/SIPconfig.xml file. Also, on koha-testing-docker the instance name is kohadev.
(In reply to David Nind from comment #4) > Hi Liz. I've signed this off, but I think the debian/docs/koha-sip.xml file > needs updating so that the option is listed in the man page for the package > command. good point, I'll make a patch for that. :)
209 echo "Warning: SIP server disabled for ${name}" Do we really want to display a warning if what has been asked has been done successfully?
Created attachment 97360 [details] [review] Bug 24340 (follow-up): Warning -> Information
Created attachment 97361 [details] [review] Bug 24340 (follow-up): Add documentation to debian/docs/koha-sip.xml
Created attachment 97379 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * the SIPconfig.xml file has been moved to SIPconfig.xml.bak * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because of no config. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 97380 [details] [review] Bug 24340 (follow-up): Warning -> Information Signed-off-by: David Nind <david@davidnind.com>
Created attachment 97381 [details] [review] Bug 24340 (follow-up): Add documentation to debian/docs/koha-sip.xml Signed-off-by: David Nind <david@davidnind.com>
My feeling is we should go the koha-email-enable/disable way, and have a file in /var/lib/koha/<instance>/sip.enabled instead of relaying on the SIPConfig.xml file for making the decision. Touching the config file looks overkill to me. I agree it could be part of enabling, if there is no config. Probably with --force-create-config or similar.
Created attachment 98257 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because it is not enabled.
Created attachment 98258 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because it is not enabled.
Created attachment 98263 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because it is not enabled. Signed-off-by: David Nind <david@davidnind.com>
Does it make sense to display the "edit ... to configure" part each time? "Enabling SIP server for kohadev - edit /etc/koha/sites/kohadev/SIPconfig.xml to configure" I think "This is the first time SIP has been enabled. Please check the configurations in /etc/koha/sites/${name}/SIPconfig.xml" is enough.
is it harmful? Just because you know what to do, doesn't mean everyone does, and the reminder can be useful when you don't do it often. I'm not keen to remove it, but I won't block a follow up doing so. Cheers, Liz
I think it's confusing to tell "edit to configure" when it is already supposed to be configured. Letting RM to decide.
Created attachment 98716 [details] [review] Bug 24340: allow koha-sip --disable inst To test: - Enable sip for your testing instance sudo koha-sip --enable inst - Start sip for your testing instance sudo koha-sip --start inst - Verify it is running ps ax |grep sip -> you should see processes - Disable sip for your testing intance sudo koha-sip --disable inst - Verify that the following has happened: * SIP is no longer running for your instance - no SIP processes * SIP Cannot be started for the instance because it is not enabled. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I think it's OK having the reminder of where the config file is.. we can certainly revisit it at a future date if we decide it's superflous.
Nice work everyone! Pushed to master for 20.05
Enhancement not pushed to 19.11.x