Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Old Zoneminder problem

12 views
Skip to first unread message

Davey

unread,
Jan 8, 2024, 10:31:02 AMJan 8
to
I have an old Dell PC, that I have used for many years to run a
Zoneminder installation. The PC runs Ubuntu 8.04LTS, Zoneminder is
v1.22.3.
It has worked pretty flawlessly for years, but suddenly I have been
getting the dreaded "Table './zm/Frames' is marked as crashed and
should be repaired" error message when trying to access any records. I
have gone round and round in the Zoneminder Forums, in which this is
frequently discussed, but I cannot get the:
<mysqlcheck --all-databases --auto-repair>
instruction to work, which is generally considered to be the correct
thing to do. If I try to navigate to:
</var/lib/mysql/zm>, as instructed, I get 'Permission denied', and I
cannot get beyond this. 'Sudo' doesn't work.
I feel that I am close to getting this working again, but I can't cross
this final hurdle.
Any help welcome.

--
Davey.

Simon

unread,
Jan 8, 2024, 11:12:14 AMJan 8
to
What is the error when using the sudo command?

--
Simon

RLU: 222126

Davey

unread,
Jan 8, 2024, 11:51:55 AMJan 8
to
sudo: cd: command not found

--
Davey.

Simon

unread,
Jan 8, 2024, 12:47:55 PMJan 8
to
So try sudo su

and then run the command from there.
--
Simon

RLU: 222126

Richmond

unread,
Jan 8, 2024, 1:16:45 PMJan 8
to
On Debian, sudo is a package, and possibly not installed by default.

i A sudo - Provide limited super user privileges to specific users

So you could try apt install sudo, but you need to be root for that. :)

su - root

To switch to the root user.

Davey

unread,
Jan 8, 2024, 2:04:40 PMJan 8
to
Hmm. I've been using sudo for about 15 years, but I'll try anything.
--
Davey.

Davey

unread,
Jan 8, 2024, 2:12:39 PMJan 8
to
On Mon, 8 Jan 2024 17:47:52 -0000 (UTC)
Well, it let me get into root, and all the way to /var/lib/mysql/zm.
So I entered the mysqlcheck command:
root@david-desktop:/var/lib/mysql/zm# mysqlcheck --all-databases
--auto-repair
mysqlcheck: Got error: 1045: Access denied for user
'root'@'localhost' (using password: NO) when trying to connect.

Grrr.
--
Davey.

Simon

unread,
Jan 8, 2024, 3:06:55 PMJan 8
to
You need to run as a user with mysql access, eg. mysql -u root -p and
give a new password.


--
Simon

RLU: 222126

Theo

unread,
Jan 8, 2024, 3:29:39 PMJan 8
to
sudo is installed, but as it says 'cd' isn't a command, it's a shell
builtin. sudo can only run executables that live on the filesystem.

ie you could run:
$ sudo bash
# cd whatever
# ./run-me.sh

or
$ cd whatever
$ sudo ./run-me.sh

but you can't
$ sudo cd whatever

Even if there was a 'cd' executable, it would change the directory in that
process and then exit, so it wouldn't affect anything in the caller.

You can use the -i flag to force sudo to launch a login shell before running
the command, so it doesn't complain:

me@machine:~$ sudo -i cd /
me@machine:~$

but as you can see it doesn't do anything: it changes directory in the shell
launched by sudo and then promptly exits that shell, effectively doing
nothing.

Theo

Davey

unread,
Jan 9, 2024, 6:23:37 AMJan 9
to
On Mon, 8 Jan 2024 20:06:53 -0000 (UTC)
It let me get into mysql, thank you very much. And I have entered the
database autorepair command, and it is sitting there doing something,
although I don't know what. Hopefully, it will eventually decide that
it has worked. All fingers crossed. The cursor flashes for a while,
then goes still, then flashes again.

--
Davey.

Davey

unread,
Jan 9, 2024, 8:52:46 AMJan 9
to
On Tue, 9 Jan 2024 11:23:35 +0000
After more than 2 hours, there was no change, so I terminated it. It
complained about a broken pipe, so maybe it was still working. I'll try
it again later, maybe with a verbose option, to see if that does
anything.

--
Davey.

Davey

unread,
Jan 9, 2024, 2:08:45 PMJan 9
to
On Tue, 9 Jan 2024 13:52:43 +0000
Well, that seems to be stuck, however ling I leave it. I tried the
mysqlcheck instruction with --verbose on the end, but it said nothing.
it seems to be doing something, but I don't know what, it's not telling
me, it never ends, but it complains 'aborted' if I stop it.
Most puzzling.
I think I'll sleep on it, and try again tomorrow.

--
Davey.

Davey

unread,
Jan 10, 2024, 10:32:07 AMJan 10
to
On Tue, 9 Jan 2024 19:08:43 +0000
How can I tell if it's actually doing anything? I started the same
process this morning, and again it seems to start the mysqlcheck
process without complaint. There is a '>' followed by a flashing cursor,
which sometimes stops flashing, and then starts again. If I stop it with
Cntrl-C, it tells me 'aborted'. But there is no other sign of progress,
it doesn't argue with the --verbose option, but it doesn't report
anything either. I am most puzzled. I'll let it run for 24 hours, that
really should be enough, even for a slow PC.

Again, any help most welcome.

--
Davey.

Theo

unread,
Jan 10, 2024, 1:03:16 PMJan 10
to
Davey <da...@example.invalid> wrote:
> How can I tell if it's actually doing anything? I started the same
> process this morning, and again it seems to start the mysqlcheck
> process without complaint. There is a '>' followed by a flashing cursor,
> which sometimes stops flashing, and then starts again. If I stop it with
> Cntrl-C, it tells me 'aborted'. But there is no other sign of progress,
> it doesn't argue with the --verbose option, but it doesn't report
> anything either. I am most puzzled. I'll let it run for 24 hours, that
> really should be enough, even for a slow PC.

'top' will tell you if it's using CPU.

'strace' will tell you what syscalls it's making, best logged to a file
eg:

strace -f -tt -o file.log mysqladmin --whatever

-f logs all the child processes as well, and -tt timestamps each one with
microseconds.

Interpreting the strace log is a bit of a skill, but just looking at the
timestamps will tell you if it's in a loop doing something, or stuck waiting
for something which never happens.


However I suspect your bigger problem will be that you need to install
strace and the package repos are long gone. It seems like the archives are
at:

http://old-releases.ubuntu.com/ubuntu/

and you can replace 'archive.ubuntu.com' with 'old-releases.ubuntu.com' in
your /etc/apt/sources.list and then apt-get update to fetch them.

Theo

Davey

unread,
Jan 10, 2024, 6:42:13 PMJan 10
to
On 10 Jan 2024 18:03:11 +0000 (GMT)
Thanks. I'll start with 'top', and see what that tells me. This is
getting more and more frustrating!
Thanks for the help,
--
Davey.

Simon

unread,
Jan 11, 2024, 3:42:40 AMJan 11
to
Usually the ">" denotes it is waiting for further input, I would
verify the command entered is correct and complete.

hth

--
Simon

RLU: 222126

Theo

unread,
Jan 11, 2024, 4:48:42 AMJan 11
to
Simon <Sim...@eu.invalid> wrote:
> Usually the ">" denotes it is waiting for further input, I would
> verify the command entered is correct and complete.

Davey, can you paste the exact command being entered and its output here?
(you can blank out any passwords that may be visible)

mysqladmin does use > as a prompt to enter commands. In this example
somebody typed 'mysqlcheck' at the mysqladmin prompt not at their command
line:

https://dba.stackexchange.com/questions/267788/how-to-check-and-repair-mysql-database-using-mysqlcheck

Simon may be right in that you're staring at a prompt and expecting it to do
something, while it's expecting *you* to do something.

Theo

Davey

unread,
Jan 11, 2024, 5:02:43 AMJan 11
to
On Thu, 11 Jan 2024 08:42:38 -0000 (UTC)
That matches what I am seeing. I just wish it would tell me what it
needs.
--
Davey.

Davey

unread,
Jan 11, 2024, 5:04:03 AMJan 11
to
On 11 Jan 2024 09:48:38 +0000 (GMT)
Yes, indeed. Some useful information there, I'll make some more
attempts. Maybe I'm close........

--
Davey.

Andy Burns

unread,
Jan 11, 2024, 6:14:48 AMJan 11
to
Davey wrote:

> Simon wrote:
>
>> Usually the ">" denotes it is waiting for further input, I would
>> verify the command entered is correct and complete.
>
> That matches what I am seeing. I just wish it would tell me what it
> needs.

mismatched quotes?

Davey

unread,
Jan 11, 2024, 6:42:33 AMJan 11
to
On 11 Jan 2024 09:48:38 +0000 (GMT)
Theo <theom...@chiark.greenend.org.uk> wrote:

IT WORKS!!

I followed the link, and it put me on the right path.
I did the same procedure as before, sudo su, cd to /var/lib/mysql/zm,
then entered the instruction:
mysqlcheck -c -u -root -p --all-databases --auto-repair
It then asked for the password, at last, and on entering it, it did the
check procedure!. Despite mysql being specifically for use while the
database is running, it complained that two tables had not been shut
down, but continued on anyway:
Extract:
zm.Stats
warning : Table is marked as crashed
warning : 5 clients are using or haven't closed the table properly
error : Found 158665 keys of 159586
error : Corrupt
zm.TriggersX10 OK

After it had finished, I Stopped Zoneminder running, and repeated the
process. And everything came back as OK. A final check, I brought up a
camera, initiated a Forced Alarm, and it finally worked.
Many, many thanks to those who have helped me.

--
Davey.

Adrian Caspersz

unread,
Jan 13, 2024, 4:17:36 AMJan 13
to
On 11/01/2024 11:42, Davey wrote:
>
> After it had finished, I Stopped Zoneminder running, and repeated the
> process. And everything came back as OK. A final check, I brought up a
> camera, initiated a Forced Alarm, and it finally worked.
> Many, many thanks to those who have helped me.

Cool stuff :)


Time now to find how to backup that application, save database
passwords, migrate the whole thing to a newer platform, thrown out a
power inefficient PC.

Hope you've blocked internet access for Ubuntu 8.04LTS, that is a bit
old....

--
Adrian C

Davey

unread,
Jan 13, 2024, 4:58:44 AMJan 13
to
On Sat, 13 Jan 2024 09:17:33 +0000
Adrian Caspersz <em...@here.invalid> wrote:

> Hope you've blocked internet access for Ubuntu 8.04LTS, that is a bit
> old....

That PC hasn't talked to the internet for years.

--
Davey.

0 new messages