Closed erikng closed 8 years ago
I like it in theory, but could the package postinstall simply run outset --login ? That's all the launchagent does. Or is it the "running under the current user context" the part that you are looking for?
I'm very confused by this. Login items run in the context of the user logging in. You can't do that when bootstrapping. What are you trying to accomplish here?
Running under the user context is what I'm after.
On Jun 24, 2015, at 8:10 PM, Joseph Chilcote notifications@github.com wrote:
I like it in theory, but could the package postinstall simply run outset --login ? That's all the launchagent does. Or is it the "running under the current user context" the part that you are looking for?
— Reply to this email directly or view it on GitHub.
Bootstrapping is the wrong word here. I think on-demand or something is better, and it should be decoupled from any login-* folders. I'll let it sink in for a bit and see if I can come up with something.
Can you try the ondemand branch? Put the new launchagent in /Library/LaunchAgents and add a new directory at /usr/local/outset/on-demand. Drop scripts in there and touch /private/tmp/.com.github.outset.ondemand.launchd. The scripts should run in the user context and behave similarly to the "login-once" scripts, i.e. they will update the plist and not run again.
I'm still not sold on the utility of this.... feedback/ideas welcome.
I won't be trying this until next Monday but not sold on the approach. If I have a script that I want to run for current users and new users, putting it in on demand isn't appropriate.
I'll play with it using my original concept and go from there.
Sent from my iPhone
On Jul 2, 2015, at 4:02 PM, Joseph Chilcote notifications@github.com wrote:
Can you try the ondemand branch? Put the new launchagent in /Library/LaunchAgents and add a new directory at /usr/local/outset/on-demand. Drop scripts in there and touch /private/tmp/.com.github.outset.ondemand.launchd. The scripts should run in the user context and behave similarly to the "login-once" scripts, i.e. they will update the plist and not run again.
I'm still not sold on the utility of this.... feedback/ideas welcome.
— Reply to this email directly or view it on GitHub.
I guess my brain just isn't processing this properly... It sounds like you just want a way to call outset --login
arbitrarily, and you don't necessarily need any new functionality.... Is that a fair assumption?
What if touching that file called outset --login
similarly to how a login triggers it? Would that suffice?
I don't really understand why there would be different triggers for "loginall" (not even sure what that means), "loginonce", "loginevery", since those would also need to go in the respective existing directories for future/other users.
I'm probably missing something very simple here. I tend to do that.
That's actually perfect, however I do see a use for what you made.
I don't think I explained it first correctly either.
So let's simplify and re explain. What I asked for: Arbitrary method to trigger --login in the current user session in an on demand method.
What might be cool/not asked for (that I think you did):
Sent from my iPhone
On Jul 2, 2015, at 4:30 PM, Joseph Chilcote notifications@github.com wrote:
I guess my brain just isn't processing this properly... It sounds like you just want a way to call outset --login arbitrarily, and you don't necessarily need any new functionality.... Is that a fair assumption?
What if touching that file called outset --login similarly to how a login triggers it? Would that suffice?
I don't really understand why there would be different triggers for "loginall" (not even sure what that means), "loginonce", "loginevery", since those would also need to go in the respective existing directories for future/other users.
I'm probably missing something very simple here. I tend to do that.
— Reply to this email directly or view it on GitHub.
Thanks for clarifying.
The method I came up with doesn't delete anything (the directories are still owned by root so the behavior is similar to the login-* scripts, i.e. uses the same plist to check if a pathname has been run before). Probably not ideal.
Other things we need to iron out:
One way around these might be to put in enough checking to make sure the 'on-demand' script(s) will only run in the context of the user currently logged in to the GUI, if a user is logged in, and leave it up to the admin whether to also add the script to login-once or login-every for future/additional logins.
That sounds like a lot of effort. I wonder if there's a cleaner way to send down on demand scripts to run in the user context? Maybe outset is not the appropriate place for this? Maybe the answer is postinstall scripts using bsexec?
The answer is never postinstall scripts using bsexec. That just makes my skin crawl.
Ha ha, fair enough. There's an answer somewhere though.
Here's something that will cause you to lose sleep: https://jamfnation.jamfsoftware.com/search.html?q=bsexec&sort=most_recent
Alright, so after playing with this some more, the "requirements" have changed a little bit. :)
I'm beginning to agree that Outset may not be the appropriate place for item 2, but we will have similar issues attempting to solve this for item 1. Perhaps touching the file and chmod to 777 (sounds ugly)?
PS. I fixed the makefile on my ondemand branch.
I edited my original post, so your e-mails may not reflect all of my notes.
"Arbitrary method to trigger --login. This will allow newly installed user scripts to immediately run."
With the possibly unwanted effect of re-running scripts that already ran at login.
Sure. In my case, I know the outcome. Hopefully (surely!) the admin knows the outcome and has tested prior to production.
Most of my scripts are login-once and the login-every are basically login-once with my own time stamp logic (both of you have seen an example of that). I have a few exceptions to that rule, but I have no worries about them running again as they are "self healing" types of scripts.
On Jul 6, 2015, at 11:00 PM, Greg Neagle notifications@github.com wrote:
"Arbitrary method to trigger --login. This will allow newly installed user scripts to immediately run."
With the possibly unwanted effect of re-running scripts that already ran at login.
— Reply to this email directly or view it on GitHub.
I've done some playing around with the on-demand plist. Going by the three items I listed above:
I'm still not sold on this idea. I like, in theory, the option to send an on-demand script that will run in the context of the current user, but I worry about numbers 1 and 2 above. There has to be a better way.
I have a (possibly horrible) idea to test out. Hopefully sometime today I can try it.
Still working through this. The on-demand stuff in there now is in flux. I kept it because I was getting PRs against that branch and I'm to dumb to use git more effectively. Ignore for the time being.
Erik, can you try the latest push to master. on-demand rules as they currently rest:
Oh, and you trigger on-demand by touching /private/tmp/.com.github.outset.ondemand.launchd
, perhaps via a postinstall.
Can you test the pre-release 1.0.3 please, and let me know if the on-demand stuff work?
I'll test tomorrow. Given the massive change log I will need to move things around.
Sent from my iPad
On Jan 3, 2016, at 5:10 PM, Joseph Chilcote notifications@github.com wrote:
Can you test the pre-release 1.0.3 please, and let me know if the on-demand stuff work?
https://github.com/chilcote/outset/releases/tag/v1.0.3
— Reply to this email directly or view it on GitHub.
This addresses the original issue and also works for arbitrarily running --login.
https://github.com/chilcote/outset/commit/af50ed8fc7b91aa36ba1e6324e24410f9bfe40eb
One of Outset's "limitations" are login-every and login-once items are ran only when a user logs in.
I'm proposing a change where you could send a dotfile to /Users/Shared which would then trigger Outset to immediately run.
/usr/bin/touch /Users/Shared/.com.outset.loginall /usr/bin/touch /Users/Shared/.com.outset.loginevery /usr/bin/touch /Users/Shared/.com.outset.loginonce
This would allow us to ensure user's are receiving a change we want them to see without a logout/reboot.
There might be other ways to skin this cat, but my main idea for this is to chain munki, yo and outset together.