tpkg / client

tpkg client code
MIT License
5 stars 7 forks source link

Support running tpkg as a non-root user #13

Open jheiss opened 12 years ago

jheiss commented 12 years ago

Currently several major tpkg features don't work if tpkg is not run as root, namely init scripts and crontabs. In both cases we currently hook into the related OS subsystem, which requires root privileges. Ideally these would be handled more like logrotate or stunnel where packages would express a dependency on a "cron" or "init" package and then drop crontabs or init scripts into /opt/tpkg/etc/cron.d or /opt/tpkg/etc/init.d and have them activated. The cron package could just run its own cron daemon and be completely independent of the OS cron system. This would eliminate the need for the flag in tpkg.xml. The init functionality is a little trickier, we would want a hook into the OS init system so that tpkg could start apps at system boot. It's not yet clear to me if we could eliminate the section of tpkg.xml.

On the cron front I looked around at the available options and it seemed to me vixie-cron was the most appropriate, but it is a crufty old-school package that wasn't easily relocated to /opt/tpkg.

Was: https://sourceforge.net/apps/trac/tpkg/ticket/14

jheiss commented 12 years ago

And as a user pointed out, if tpkg were always running init scripts itself we could support an option in tpkg.xml to indicate what user to run the init script as, so that developers didn't have to deal with calling su themselves. I'm still not certain this is a good idea, as outside observers looking at the init script wouldn't see any indication about what user the script would run as, but the convenience for developers might be worth it.

Was: https://sourceforge.net/apps/trac/tpkg/ticket/14#comment:1

jheiss commented 12 years ago

As mentioned in https://github.com/tpkg/client/issues/12 regarding init scripts, it would be nice if we could source /opt/tpkg/etc/profile.d/* before running cron jobs, as it is a common feature request that users be able to set environment variables that are always available to their application.

Was: https://sourceforge.net/apps/trac/tpkg/ticket/14#comment:2

jheiss commented 12 years ago

Be sure to see https://github.com/tpkg/client/issues/12 for the way we decided to handle init scripts. This ticket remains to cover the overall goal of supporting non-root usage, and specifically the cron functionality.

Was: https://sourceforge.net/apps/trac/tpkg/ticket/14#comment:3