Running gsettings as root
Karl Auer
kauer at biplane.com.au
Wed Aug 17 10:07:42 UTC 2016
On Wed, 2016-08-17 at 11:21 +0200, Josef Wolf wrote:
> I want to do lots of configuration settings as root in the background
> [...]
> I need a command that works independently of whether the user is
> logged in or not.
You could run your scripts setuid, though setuid scripts are dangerous
- make very sure they are not editable by anyone but root, and make
sure that the commands they execute are not subvertible, and use full
paths to every executable they call.
You could run your scripts from the system crontab, which allows the
user to be specified. This would be my preference, especially if they
are to be run regularly.
A script (with the right permissions) placed in one of the /etc/cron.*
directories will be run at those intervals. So you can put (copy of) a
script there, then take it out (or have it delete itself) after it has
run.
You could run your scripts as startup scripts (systemd).
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389
GPG fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B
Old fingerprint: 3C41 82BE A9E7 99A1 B931 5AE7 7638 0147 2C3C 2AC4
More information about the ubuntu-users
mailing list