{"action":"created","issue":{"url":"https://api.github.com/repos/freedev/macosx-script-boot-shutdown/issues/1","labels_url":"https://api.github.com/repos/freedev/macosx-script-boot-shutdown/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/freedev/macosx-script-boot-shutdown/issues/1/comments","events_url":"https://api.github.com/repos/freedev/macosx-script-boot-shutdown/issues/1/events","html_url":"https://github.com/freedev/macosx-script-boot-shutdown/issues/1","id":125159249,"number":1,"title":"Error: Unable to commit changes to network database","user":{"login":"faxotherapy","id":6538008,"avatar_url":"https://avatars.githubusercontent.com/u/6538008?v=3","gravatar_id":"","url":"https://api.github.com/users/faxotherapy","html_url":"https://github.com/faxotherapy","followers_url":"https://api.github.com/users/faxotherapy/followers","following_url":"https://api.github.com/users/faxotherapy/following{/other_user}","gists_url":"https://api.github.com/users/faxotherapy/gists{/gist_id}","starred_url":"https://api.github.com/users/faxotherapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faxotherapy/subscriptions","organizations_url":"https://api.github.com/users/faxotherapy/orgs","repos_url":"https://api.github.com/users/faxotherapy/repos","events_url":"https://api.github.com/users/faxotherapy/events{/privacy}","received_events_url":"https://api.github.com/users/faxotherapy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-06T11:23:00Z","updated_at":"2016-01-07T17:24:42Z","closed_at":null,"body":"Dear Sir,\r\n\r\nI've been using your scripts successfully and I find it extremely useful for my use. I thank you for your job very much. However, I'd like raise what seem to be a small issue written in the log file:\r\n```\r\nWed Jan 6 11:11:49 GMT 2016   root  Received a signal to shutdown\r\n** Error: Unable to commit changes to network database.\r\n** Error: Unable to commit changes to network database.\r\n** Error: Unable to commit changes to network database.\r\n** Error: Unable to commit changes to network database.\r\n** Error: Unable to commit changes to network database.\r\n** Error: Unable to commit changes to network database.\r\n```\r\n\r\nAlthough the script seems to perform my desired action well at shutdown time, above statements appear in the log file.\r\n\r\nWhat do you think?\r\n\r\nThank you for your help.\r\n\r\nFaxopita"},"comment":{"url":"https://api.github.com/repos/freedev/macosx-script-boot-shutdown/issues/comments/169743397","html_url":"https://github.com/freedev/macosx-script-boot-shutdown/issues/1#issuecomment-169743397","issue_url":"https://api.github.com/repos/freedev/macosx-script-boot-shutdown/issues/1","id":169743397,"user":{"login":"faxotherapy","id":6538008,"avatar_url":"https://avatars.githubusercontent.com/u/6538008?v=3","gravatar_id":"","url":"https://api.github.com/users/faxotherapy","html_url":"https://github.com/faxotherapy","followers_url":"https://api.github.com/users/faxotherapy/followers","following_url":"https://api.github.com/users/faxotherapy/following{/other_user}","gists_url":"https://api.github.com/users/faxotherapy/gists{/gist_id}","starred_url":"https://api.github.com/users/faxotherapy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faxotherapy/subscriptions","organizations_url":"https://api.github.com/users/faxotherapy/orgs","repos_url":"https://api.github.com/users/faxotherapy/repos","events_url":"https://api.github.com/users/faxotherapy/events{/privacy}","received_events_url":"https://api.github.com/users/faxotherapy/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T17:24:42Z","updated_at":"2016-01-07T17:24:42Z","body":"Thanks for your reply. Here's what you asked:\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\r\n<plist version=\"1.0\">\r\n<dict>\r\n<!--\r\n    You should customize the following placeholders:\r\n- BOOT.SHUTDOWN.SERVICE : If you don't know, leave it as is\r\n- SCRIPT_PATH : the path where the boot-shutdown.sh script is stored. \r\n- LOG_PATH : the path where the logs are stored. If you don't care about logs, use: /tmp\r\n-->\r\n\r\n<key>Label</key>\r\n<string>BOOT.SHUTDOWN.SERVICE</string>\r\n\r\n<key>ProgramArguments</key>\r\n<array>\r\n  <string>/Users/nfa/bin/boot-shutdown.sh</string>\r\n</array>\r\n\r\n<!--\r\nset RunAtLoad false if you don't want that script starts \r\nautomatically every time your mac os x boots\r\n-->\r\n<key>RunAtLoad</key>\r\n<true/>\r\n\r\n<key>WorkingDirectory</key>\r\n<string>/Users/nfa/bin/</string>\r\n\r\n<key>StandardOutPath</key>\r\n<string>/usr/local/var/log/boot-shutdown/boot-shutdown.log</string>\r\n\r\n<key>StandardErrorPath</key>\r\n<string>/usr/local/var/log/boot-shutdown/boot-shutdown.err</string>\r\n\r\n<key>ExitTimeOut</key>\r\n<integer>600</integer>\r\n\r\n</dict>\r\n</plist>\r\n```\r\n\r\n```\r\n#!/bin/bash\r\n\r\n#\r\n# Author: Vincenzo D'Amore v.damore@gmail.com\r\n# 20/11/2014\r\n#\r\n\r\nfunction shutdown()\r\n{\r\n  echo `date` \" \" `whoami` \" Received a signal to shutdown\"\r\n\r\n  # INSERT HERE THE COMMAND YOU WANT TO EXECUTE AT SHUTDOWN\r\n  /usr/sbin/networksetup -setsecurewebproxy   \"Thunderbolt Ethernet\" 127.0.0.1      8118;\r\n  /usr/sbin/networksetup -setwebproxy         \"Thunderbolt Ethernet\" 127.0.0.1      8118;\r\n  /usr/sbin/networksetup -setdnsservers       \"Thunderbolt Ethernet\" 185.10.203.37  \\\r\n                                                                     185.83.217.248 \\\r\n                                                                     85.25.105.193  \\\r\n                                                                     50.116.40.226  \\\r\n                                                                     172.81.176.146 \\\r\n                                                                     8.8.8.8        \\\r\n                                                                     8.8.4.4;\r\n  /usr/sbin/networksetup -setsecurewebproxy   \"Wi-Fi\" 127.0.0.1      8118;\r\n  /usr/sbin/networksetup -setwebproxy         \"Wi-Fi\" 127.0.0.1      8118;\r\n  /usr/sbin/networksetup -setdnsservers       \"Wi-Fi\" 185.10.203.37  \\\r\n                                                      185.83.217.248 \\\r\n                                                      85.25.105.193  \\\r\n                                                      50.116.40.226  \\\r\n                                                      172.81.176.146 \\\r\n                                                      8.8.8.8        \\\r\n                                                      8.8.4.4;\r\n  exit 0\r\n}\r\n\r\nfunction startup()\r\n{\r\n  echo `date` \" \" `whoami` \" Starting...\"\r\n\r\n  # INSERT HERE THE COMMAND YOU WANT TO EXECUTE AT STARTUP\r\n\r\n  tail -f /dev/null &\r\n  wait $!\r\n}\r\n\r\ntrap shutdown SIGTERM\r\ntrap shutdown SIGKILL\r\n\r\nstartup;\r\n```"}}