On Sunday 20 December 2020 15:07:26 Michael via tde-users wrote:
On Sunday 20 December 2020 11:02:15 am Gene Heskett
via tde-users wrote:
On Sunday 20 December 2020 10:50:44 Michael via
tde-users wrote:
On Saturday 19 December 2020 07:39:34 pm Gene
Heskett via
tde-users
wrote:
> On Saturday 19 December 2020 19:15:47
Michael via tde-users wrote:
> > On Saturday 19 December 2020 11:15:43 am Michael via tde-users
wrote:
> >
On Saturday 19 December 2020 08:34:37 am Gene Heskett via
> > tde-users
wrote:
> > > On Saturday 19 December 2020
03:32:07 Gene Heskett wrote:
> >
> > Hi Gene,
> >
> > Thanks for posting the dcop commands, I’ve been meaning to
> > add similar to my local nightly backup for awhile.
> >
> > On the permissions issue:
> >
> > Use sudo, basically the same as using sudo for yourusername
> > to root, but replace root with yourusername and yourusername
> > with amanada. And then get sudo to run without password.
> >
> > -
> >
https://www.golinuxhub.com/2013/12/how-to-give-permission-to
> >-use r-to -run/ -
> >
https://linuxhandbook.com/sudo-without-password/
This second URL showed me how to edit the sudoers file and add
this:
amanda ALL=(ALL) NOPASSWD:/opt/trinity/bin/dcop
But it still fails:
root@coyote:~$ su amanda -c "/opt/trinity/bin/dcop --user gene
--all-sessions kmail KMailIface resumeBackgroundJobs"
sudo NOT su... Read the first link, they go together... AFIK,
you'll need to reformat the whole command for sudo (as it is not
the same format as su).
Don't run as root either! Run it as plain amanda, even if you
have to stick it in a test script and add it to amanda cron to
kick it off.
No, since they've built a paranoid security wall between me and
anybody else, I'll run it as me.
Well, that is sucky :(
For the display issues earlier, try one of these:
export DISPLAY=:0
export DISPLAY=:0.0
Under your username do:
echo $DISPLAY
and I’m guessing use that. Mine is “:0”, the :0.0 was used in a cron
entry itself*, so probably not the one to use.
This is from an old bash script I ran in root cron that needed to also
start something as myself. It was on a Ubuntu 14.04 box, it’s Debian
based but might not be the exact syntax anymore.
export DISPLAY=:0
sudo -H -u michael bash -c '/usr/bin/progname &'
As long as you have the right sudoers entry (it looked like you had
way overkill, but it should work), running the same in the amanda
script should work.
That entry, previously shown in this thread was an sudoers killing syntax error, so its
been removed. thanks to having
more than one root session going at the time.
I’ll guess this should be the full syntax of the
lines you need:
export DISPLAY=:0
probably not needed, these scripts normally only send emails.
sudo -H -u gene bash -c '/opt/trinity/bin/dcop
kmail KMailIface
pauseBackgroundJobs'
how about, since the commands are already defined above it:
sudo -H -u gene bash -c "$Cmdholdit" ? etc. or "$Cmdresume" at the
end?
>do backup
stuff<<
sudo -H -u gene bash -c '/opt/trinity/bin/dcop kmail KMailIface
resumeBackgroundJobs'
HTH,
Michael
But it doesn't work, its asking for amanda's pw and there isn't one.
Here is what I did:
root@coyote:~$ su amanda
amanda@coyote:/root$ echo $Cmdresume
amanda@coyote:/root$ Cmdresume="/opt/trinity/bin/dcop kmail KMailIface
resumeBackgroundJobs"
amanda@coyote:/root$ echo $Cmdresume
/opt/trinity/bin/dcop kmail KMailIface resumeBackgroundJobs
amanda@coyote:/root$ sudo -H -u gene bash -c $Cmdresume
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for amanda:
Sorry, try again.
[sudo] password for amanda:
So I'll just do it from my own crontab, holding the background stuff
for an hour 31 while amanda is running.
Like this:
59 1 * * * /opt/trinity/bin/dcop kmail KMailIface pauseBackgroundJobs
30 3 * * * /opt/trinity/bin/dcop kmail KMailIface resumeBackgroundJobs
And we'll see if that works.
* Cron entry was like:
export DISPLAY=:0.0 ; /home/michael/common/bin/bashscript.sh
____________________________________________________
tde-users mailing list -- users(a)trinitydesktop.org
To unsubscribe send an email to users-leave(a)trinitydesktop.org
Web mail archive available at
https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@trinity
desktop.org
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>