The officially official Devuan Forum!

You are not logged in.

#51 2021-04-01 13:32:24

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 542  

Re: [SOLVED] Permissions for script in cron

Once done, how should I test that everything is working properly?

One confirmation would be that your fstrim logging shows up.

A manual forced test would be like before, i.e. if live-config is uninstalled, then

sudo /usr/sbin/anacron -s -d -n -f

should be telling about running the cron.{daily,weekly,monthly} jobs.

Offline

#52 2021-04-01 13:56:31

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] Permissions for script in cron

Hello:

ralph.ronnquist wrote:

One confirmation would be that your fstrim logging shows up.
... manual forced test would be like before, i.e. if live-config is uninstalled, then ...

sudo /usr/sbin/anacron -s -d -n -f

... should be telling about running the cron.{daily,weekly,monthly} jobs.

Right.

I'll do all that and report back, hopefully marking this long thread as [Solved].

----
Edit:
Done.
No more /usr/sbin/anacron --> /bin/true

groucho@devuan:~$ ls -l /usr/sbin/anacron.orig.anacron
-rwxr-xr-x 1 root root 34832 May 19  2019 /usr/sbin/anacron.orig.anacron
groucho@devuan:~$
groucho@devuan:~$
dpkg -S anacron.orig.anacron
diversion by live-config from: /usr/sbin/anacron
diversion by live-config to: /usr/sbin/anacron.orig.anacron
groucho@devuan:~$ 
groucho@devuan:~$ ls -l /usr/sbin/anacron
lrwxrwxrwx 1 root root 20 Apr  1 11:06 /usr/sbin/anacron -> anacron.orig.anacron
groucho@devuan:~$ 
groucho@devuan:~$ dpkg -S /usr/sbin/anacron
diversion by live-config from: /usr/sbin/anacron
diversion by live-config to: /usr/sbin/anacron.orig.anacron
anacron: /usr/sbin/anacron
groucho@devuan:~$ 

I have purged it but I see that the diversion by live-config is still there.
How to go back to the 'original' pre-live-config configuration?

It seems to be working.  8^D!

groucho@devuan:~$ 
groucho@devuan:~$ sudo /usr/sbin/anacron -s -d -n -f
[sudo] password for groucho: 
Anacron 2.3 started on 2021-04-01
Job `cron.daily' locked by another anacron - skipping
Job `cron.weekly' locked by another anacron - skipping
Job `cron.monthly' locked by another anacron - skipping
Normal exit (0 jobs run)
groucho@devuan:~$ 
groucho@devuan:~$ 

----

Once done, who/where would I have to report this problem to?

Does not seem to originate inrefractainstaller-base, more like in the required live-config.
Or is it related to the bug report I linked to?

Don't think is would be a good thing just to leave it be. (?)

Thank you very much for the time and effort you put into solving this problem for me.
Really appreciate it.

Best,

A.

Last edited by Altoid (2021-04-01 14:34:40)

Online

#53 2021-04-01 15:48:54

fsmithred
Administrator
Registered: 2016-11-25
Posts: 1,840  

Re: [SOLVED] Permissions for script in cron

uh-oh...

I haven't been paying close attention to this thread.

live-config messes with anacron via the live-config script, /lib/live/config/1110-anacron which uses dpkg-divert to disable anacron. This is useful in a live-CD where everything is read-only.
This only activates when you boot into a live system, not an installed system.

Refractainstaller copies the RUNNING live system to hard drive.

You just uncovered a 10-year-old bug that I didn't know about. The installer needs to undo this during the installation.

I suspect that the right way to undo it is to use dpkg-divert.

# ls -l /usr/sbin/anacron*
lrwxrwxrwx 1 root root     9 Apr  2  2018 /usr/sbin/anacron -> /bin/true
-rwxr-xr-x 1 root root 38928 Feb  6 14:18 /usr/sbin/anacron.orig.anacron

# dpkg-divert --remove /usr/sbin/anacron
dpkg-divert: warning: please specify --no-rename explicitly, the default will change to --rename in 1.20.x
Removing 'diversion of /usr/sbin/anacron to /usr/sbin/anacron.orig.anacron by live-config'

And then to verify that it really did what it was supposed to do (but did not):

# ls -l /usr/sbin/anacron*
lrwxrwxrwx 1 root root     9 Apr  2  2018 /usr/sbin/anacron -> /bin/true
-rwxr-xr-x 1 root root 38928 Feb  6 14:18 /usr/sbin/anacron.orig.anacron

Yet dpkg-divert thinks it did the right thing:

# dpkg-divert --remove /usr/sbin/anacron
dpkg-divert: warning: please specify --no-rename explicitly, the default will change to --rename in 1.20.x
No diversion 'any diversion of /usr/sbin/anacron', none removed.

Computer, do as I say!

# mv /usr/sbin/anacron.orig.anacron /usr/sbin/anacron
# ls -l /usr/sbin/anacron*
-rwxr-xr-x 1 root root 38928 Feb  6 14:18 /usr/sbin/anacron
root@nomad:/home/phred# 

I'll reboot and see what happens.

Update: I see this in syslog for the first time after reboot. I think it's working now.

Apr  1 15:44:42 localhost anacron[1828]: Will run job `cron.daily' in 5 min.
Apr  1 15:44:42 localhost anacron[1828]: Will run job `cron.weekly' in 10 min.
Apr  1 15:44:42 localhost anacron[1828]: Will run job `cron.monthly' in 15 min.

Offline

#54 2021-04-01 19:54:43

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] Permissions for script in cron

Hello:

fsmithred wrote:

uh-oh...
I haven't been paying close attention to this thread.

Tsk, tsk ...  8^D!!!

Can't do everyhting.

fsmithred wrote:

live-config messes with anacron via the live-config script ...

So it seems.

fsmithred wrote:

... useful in a live-CD where everything is read-only.
... only activates when you boot into a live system, not an installed system.

Yes.

fsmithred wrote:

Refractainstaller copies the RUNNING live system to hard drive.

The post at Dev1 that I linked to, which had the same /usr/sbin/anacron --> /bin/true and deviations apparently was not/had not been using Refractainstaller.

So something other used live-config and generated the same problem.
https://dev1galaxy.org/viewtopic.php?id=1901

ie: this would not be specific to the refractainstaller but to how live-config is used by any application. (?) 

fsmithred wrote:

You just uncovered a 10-year-old bug ...

No.

It was ralph.ronnquist who saw it and pointed it out to me while helping me sort out the problem I was having with anacron.
https://dev1galaxy.org/viewtopic.php?pid=28663#p28663
I just observed and tried to pay attention.

A question just occurred to me: in 10 years, no one else using refractainstaller had a problem/issue with anacron?
Maybe there's something that's not working right.

ie:
I realised what was going on when I saw that my fstrim script was not logging.
If not for that, I would have never known about what was going on with anacron.
And I don't recall any system notifications warning me of anacron failures.

Not good, no?

fsmithred wrote:

The installer needs to undo this during the installation.

Sure.

But it is live-config that is making a signifficant change.
No clean-up after use?
A notification of some sort?

eg:

Don't forget to clean up /usr/sbin/anacron --> /bin/true afterwards.

fsmithred wrote:

I see this in syslog for the first time after reboot.
... it's working now.

Apr  1 15:44:42 localhost anacron[1828]: Will run job `cron.daily' in 5 min.
Apr  1 15:44:42 localhost anacron[1828]: Will run job `cron.weekly' in 10 min.
Apr  1 15:44:42 localhost anacron[1828]: Will run job `cron.monthly' in 15 min.

Yes, it's working.

Thanks a lot for your input.

Best,

A.

Last edited by Altoid (2021-04-01 19:59:11)

Online

#55 2021-04-02 09:44:55

fsmithred
Administrator
Registered: 2016-11-25
Posts: 1,840  

Re: [SOLVED] Permissions for script in cron

The post at Dev1 that I linked to, which had the same /usr/sbin/anacron --> /bin/true and deviations apparently was not/had not been using Refractainstaller.

So something other used live-config and generated the same problem.
https://dev1galaxy.org/viewtopic.php?id=1901

That was a miyolinux system, which uses refractainstaller.

The way it's designed, the live-config change should not need to be undone as it only exists in the running live system. If you mount the filesystem inside the live-iso to look at it when it's not running, you would find that the diverted file does not exist. It gets created by live-config when the system boots.

Offline

#56 2021-04-02 10:42:56

Altoid
Member
Registered: 2017-05-07
Posts: 676  

Re: [SOLVED] Permissions for script in cron

Hello:

fsmithred wrote:

That was a miyolinux system ...

Indeed ...

GNUser wrote:

I did not install any live-config packages, so they must have come with Miyo.

The poster was right.
I didn't now about refractainstaller being used by Miyo.

fsmithred wrote:

... the live-config change should not need to be undone as it only exists in the running live system.

Now it's fixed.

Thanks for your input.

Best,

A.

Online

Board footer