What's the sense of having LaunchAgents is they can't be changed?
I have a partitioned hard-disk with two operating systems on it. One is Sierra (10.12), and the other is Yosemite (10.10). Sierra has Security Integrity Protection (SIP), but Yosemite doesn't. However, SIP blocks BOTH systems from allowing modifications of $HOME/Library/LaunchAgents. I was able to 'disable' SIP on Sierra, but apparently SIP information isn't stored on the disk; it's stored in NVRAM. The result is that I can't alter LaunchAgents on the Yosemite side. According to the "Configuring System Integrity Protection" Guide, the protection applies across the entire machine, to every system installed. BUT what I've found is that unless a system has the '/usr/bin/csrutil' module, you can't 'disable' SIP on that system. So now my Yosemite system is useless when it comes to launchctl and my $HOME/Library/LaunchAgents directory.
How can I 'disable' SIP on Yosemite? I have it disabled on Sierra, which contradicts the Guide's explanation.
Each system is operating separately, not via a common NVRAM setting.
===============
I found a solution. I set my 'Startup Disk' to point to my Sierra system. Using 'cmd-R', I restarted on my Sierra system, and got to the 'macOS Utility' where I used 'Terminal' from the Utility menu, and did 'csrutil disable' to disable SIP.. I quit macOS Utility, which leads to a normal restart. I'm now on my account, where my $HOME/Library/LaunchAgents was blocked from adding or removing. I did 'cd ..' to get back one level, and then 'mkdir NewAgents', which creates another directory parallel to LauchAgents. I was now able to 'cp -p LaunchAgents/* NewAgents/.' , which copied all plists over to NewAgents. Then, I did this:
sudo bash # enter your password to become 'root'
rm -rf LaunchAgents # delete the entire LaunchAgents, which eliminates the SIP lock.
exit 0 # return to being myself.
mv NewAgents LaunchAgents # create a new LaunchAgents with no SIP lock.
I set the permissions with 'chmod 755 LaunchAgents', and now everything works. I can add/remove from my LaunchAgents. I then went to my Yosemite system holding down the Option key on Restart, and did the same thing. Finally, with Restart still pointing at Sierra, I used 'cmd-R' again to get to 'macOS Utility', and did 'csrutil enable' in Terminal. Now both systems are protected by SIP, and I can alter my LaunchAgents as needed on either system.
NOTE: LaunchAgents and LaunchDaemons in /Library are modifiable by 'root'.