Okay so given all this, here's a permanent solution that appears to be innocuous. By the use of crontab, I'm going to kill the accountsd process every morning at 1:00am. Easy to install - here's the steps - and while it takes a little technical knowhow - not much. Also, use this at your own risk. I've not tested running this script forever. It doesn't seem to cause any issue but I'm not responsible either way.
cd /tmp
- and press enter. That will take you to the tmp directory
- use vi to create this simple shell script in the /tmp directory - first launch vi by typing:
vi kill_accountsd.sh
- Go into insert mode by type the letter i
- Copy and past the below text into vi
echo "$(date) - Starting accountsd kill process..." >> /tmp/kill_accountsd.out
killall -9 accountsd
echo "Killed..." >> /tmp/kill_accountsd.out
- Save and exit vi by pressing escape and then typing colon and wq! - in other words, type
:wq!
- and press enter. That will create the shell script in your tmp directory. You can see that it's there by typing:
ls -ltr kill*
- Change the shell script to executable by typing:
chmod a+x kill_accountsd.sh
* Okay now you have an executable script in your tmp directly. Now we need to install into cron. Cron is just a process that wakes up whenever you tell it to and runs commands (usually a shell script, etc.). At the prompt type:
crontab -e
- You'll be take to a vi session where you can edit the various cron commands. This is very much like using vi (in fact it is) so type the letter i to insert, and then you'll want to enter this rather cryptic line:
5 1 * * * . /tmp/kill_accountsd.sh
- There's a space between each number and asterisk AND a space between the period and the /tmp. What this is saying is, wake up every morning at 1:05am and run this script.
- Hit the escape and save by typing:
:wq!
And that's it. The script will be launched every morning at 1:05am and it will kill the accountsd process and write out what it did to a log in the /tmp directory called "kill_accountsd.out". If you're so inclined after doing this, the next day bring up terminal, change to the /tmp directory and type:
cat kill_accountsd.out
And it will show you hopefully that it awakened and killed the process, which restarts automatically anyway. I'm going to try this on both of my macs and keep it running for a while.
By the way, to stop this from running, edit your crontab using the 'crontab -e' command above and navigate to the line using your arrow keys (do not press 'i') and type 'dd' and it will delete the line. Or you navigate to the start of that line, press 'i' and enter a pound side at the first character '#' and that comments out the line. Then save with ':wq!' and you're good.
Let me know if anyone else does this and how it turns out. Not a great fix but stops the bleeding.