paride | blackboxsw, heh right I should check ubot5, I'm not sure on how that's configured | 07:07 |
---|---|---|
paride | LP: #1234 | 08:18 |
ubottu | Launchpad bug 1234 in Launchpad itself "Gina is an unmaintainable mess of command line options, environment variables and shell scripts" [Medium, Fix Released] https://launchpad.net/bugs/1234 | 08:18 |
paride | https://github.com/canonical/cloud-init/pull/916 | 08:18 |
ubottu | Pull 916 in canonical/cloud-init "Change module order: run 'users-groups' before 'write-files'" [Open] | 08:18 |
paride | blackboxsw, ^^ ubottu replaces ubot5 and also knows some more tricks! | 08:18 |
tsujp | When do user-data scripts execute? | 14:56 |
tsujp | Things like $USER and $HOME don't exist in `env` in my debug attempts | 14:56 |
goneri | tsujp, I would try something like: `sudo -i -u myuser mycommand` | 15:07 |
tsujp | ok goneri will try now | 15:09 |
tsujp | where is this `-i` and `-u` coming from goneri? I don't see those as valid flags on ubuntu `su`? | 15:11 |
tsujp | `man su` doesn't show them | 15:11 |
goneri | my example is based on sudo. You can do the same thing with su. | 15:12 |
tsujp | oh whoops `sudo` read that as `su` for some reason... | 15:12 |
tsujp | well im already root, right. This is a user-data script | 15:12 |
tsujp | I'm going to re-try `su -l myuser` to double check it does not work | 15:13 |
tsujp | Why would `sudo` from root be any different? | 15:13 |
goneri | yes but by doing so you impersonate the user. | 15:13 |
tsujp | if mycommend is a shell script will that keep the impersonation? | 15:13 |
goneri | yes. Take a look at the docuementation of sudo's -i/--login parameter | 15:14 |
tsujp | will do goneri | 15:21 |
tsujp | Yeah you guys were right, turns out I was a big dumb dumb and because I was testing this locally in an interactive-shell doing `su - myuser` drops me into that shell | 15:25 |
tsujp | but because it's interactive it doesnt immediately exit right | 15:25 |
tsujp | What a brainfart that took like 30 minutes to alleviate, maybe it's bed time for me | 15:26 |
tsujp | Anyway thank you for the help :) | 15:26 |
goneri | Good night tsujp :-) | 15:26 |
rharper | paride: thanks for the bot upgrade | 17:24 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!