Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Remap user-level environment to system-level for services. #269
Conversation
|
Can one of the admins verify this patch? |
mvo5
reviewed
Dec 21, 2015
| @@ -352,7 +352,7 @@ WantedBy={{.ServiceSystemdTarget}} | ||
| servicesSystemdTarget, | ||
| origin, | ||
| arch.UbuntuArchitecture(), | ||
| - "%h", | ||
| + "/var/lib", // Remap user-level environment to system-level for services |
mvo5
Dec 21, 2015
Collaborator
Thanks for adding a comment here, maybe add a tiny bit more like "Remap user-level environment to system-level for services. The code will append "apps/$appname/$version" to this path"
|
Thanks for this branch! Looks excellent :) One tiny suggestion for the comment inline, but no blocker at all. |
|
@mvo5 thanks for the review! I've updated the comment as you suggested. |
|
It would be great if we can get this back into 15.04 as well. |
|
ok to test |
|
|
kyrofa
referenced this pull request
Dec 22, 2015
Merged
Backport to 15.04: Remap user-level environment to system-level for services. #273
|
retest this please |
|
The integration tests error is not related to this branch. I'm fixing it here: ubuntu-core#284 Also, I propose we add kyrofa to the whitelist: ubuntu-core/snappy-jenkins#35 |
elopio
referenced this pull request
Jan 5, 2016
Closed
Re-add some support for /oem and the OEM snap type #265
|
@kyrofa could you write an integration test that installs and runs a snap with a service that logs something? Let me know if you need a hand. :D |
|
@elopio sure! Thanks for fixing the integration tests |
|
A couple of questions: does it make sense for a service application to be using the user data directory, if there's no associated user? How/why would that happen? Then, if the application does make a distinction between those, isn't it problematic that we're mapping two paths that are generally taken to be in different places pointing to the same directory? I can easily imagine an application using conflicting names within the two directories (e.g. "config" in both). |
@niemeyer Ideally no. My particular use-case is ROS. You have a good point, though. I don't think we should have an environment variable pointing to an invalid location (like we do now), but perhaps the better fix would be to actually create that directory instead of remapping it. Perhaps the creation of user data paths should be moved within ubuntu-core-launcher instead of the binary wrappers, which would allow services to have that functionality as well. Thoughts? |
|
Agreed it would be nice to have the user data directory present at all times, so applications wouldn't have to worry themselves about which context they're running under. I'm concerned about the interaction between this issue and what we're addressing in #264, though. At the time, it sounded like using /root was the right thing to do for sudo. But now we have another facet of the same problem, because /root ends up being picked for the services merely because that's the user they run as. Isn't it awkward that when run as "a service" (a concept we're trying to deprecate slightly, see context in snappy-devel@) an application would use /var/lib as its user data path, and when run under sudo, it would use /root? |
|
Agreed, the inconsistency is bothersome. We can resolve it if we scrap this PR and move the user data directory creation into ubuntu-core-launcher, yes? That at least allows ROS services to run, even if they don't log to an ideal location. |
|
Please let me have a conversation with the team tomorrow first, so you don't waste any time. First thing to do is to decide what is the convention we want for snap data storage in general. |
|
Sounds good, let me know. |
|
I'm closing this so we can more easily wait for it (or another PR) to reflect the agreement in the mailing list. |
kyrofa commentedDec 18, 2015
Currently Snappy services define
$SNAP_APP_USER_DATA_PATHto be within /root/apps, however, there is no logic to create the$SNAP_APP_USER_DATA_PATHlike there is within binary wrappers, which means any service that tries to use$SNAP_APP_USER_DATA_PATHis trying to use a non-existing directory.Having services write caches or logs into /root doesn't really make sense anyway, so this PR remaps the user-level environment into the system-level environment (i.e.
$SNAP_APP_USER_DATA_PATHnow =$SNAP_APP_DATA_PATH) for services.Fixes LP: #1527612