Hi, My Centos 4.4 server at home is serving a Samsung SCX-4521F printer, which the *nix and Win clients connect to through ipp. Every so often (maybe once a month), the cupsd.conf and mime.types files are updated, which makes the printer unavailable to the clients. My fix so far has been to stop cups, overwrite the files with cupsd.conf.working and mime.types.working (these are backup files of the originial working files), then start cups. Now my question is - how simple would it be to make a bash script that will monitor if the files have been updated, then perform the above actions automatically? Or, how would I stop the files from being updated in the first place? I seem to remember coming across an article about cups-config-daemon, which can update the files occasionally - I have disabled cups-config-daemon in chkconfig, but somehow these 2 files are still being updated.
Thanks for any advice!
-justin
It would be easy to write a script to do that. You could have it start at boot time, and run every 10-15 minutes by adding a sleep statement at the end of the loop, or having it run every 10-15 minutes as a cron job. I prefer the cron method.
The script could compare mtimes or calculate and compare checksums of the files, and when every they differ, overwrite the new ones with the *.working ones. Very easy to do, if you know some simple shell scripting.
On Wednesday 28 March 2007 16:11, Justin Barth wrote:
My Centos 4.4 server at home is serving a Samsung SCX-4521F printer, which the *nix and Win clients connect to through ipp. Every so often (maybe once a month), the cupsd.conf and mime.types files are updated, which makes the printer unavailable to the clients. My fix so far has been to stop cups, overwrite the files with cupsd.conf.working and mime.types.working (these are backup files of the originial working files), then start cups. Now my question is - how simple would it be to make a bash script that will monitor if the files have been updated, then perform the above actions automatically? Or, how would I stop the files from being updated in the first place?
I've had this problem myself. I was lazy at the time and rather than find the true cause of the issue I just made the files immutable which stops them being overwritten by any process even if said process operates as root.
As root simply chattr +i cupsd.conf and mime.types from a command prompt.