You are not logged in.
Hello:
Still working on my Asus 1000HE. 8^°
I have set up zram / zramswap with this script which I found referenced here.
Just in case, I added both the shebang (#!/bin/sh) and the usual PATH= variable as I saw it was missing.
I then named it zramswap, copied it to /etc/init.d, made it executable and did update-rc.d zramswap defaults.
The problem I have is that it does not start at boot and I can't figure out why.
But I can start it from a terminal:
$ sudo zramswap start
Setting up swapspace version 1, size = 1002.6 MiB (1051303936 bytes)
no label, UUID=05decff9-d90e-4db3-ae9d-a65484a3462c
$
$ sudo swapon -s
Filename Type Size Used Priority
/dev/sda5 partition 12595196 0 1
/dev/zram0 partition 1026664 0 20
~$
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 12595196 0 1
/dev/zram0 partition 1026664 0 20
$
$ sudo zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle 1002.6M 4K 74B 4K 2 [SWAP]
$
I can't get anything from running the script in a terminal either:
# /etc/init.d/zramswap start > /tmp/zramswap.log 2>&1
#
# cat /tmp/zramswap.log
# <- nothing to see here ...
Just in case ...
#!/bin/sh
#!/usr/bin/env /lib/init/init-d-script
### BEGIN INIT INFO
# Provides: zramswap
# Required-Start: $syslog $time $remote_fs
# Required-Stop: $syslog $time $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Linux zramswap setup
# Description: Debian init script for zramswap
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/zramswap
PIDFILE=none
_is_active() {
$DAEMON status >/dev/null 2>&1
return $?
}
do_start_prepare() {
if _is_active; then
log_warning_msg "$NAME is already active"
exit 3
fi
}
do_start_cmd_override() {
$DAEMON start
}
do_stop_prepare() {
if ! _is_active; then
log_warning_msg "$NAME is not active"
exit 3
fi
}
do_stop_cmd_override() {
$DAEMON stop
}
do_status_override() {
$DAEMON status
}
do_restart_override() {
if _is_active; then
$DAEMON restart
else
$DAEMON start
fi
}
How to troubleshoot this further?
Thanks in advance.
Best,
A.
Last edited by Altoid (2025-05-18 15:58:12)
Offline
Hello.
... troubleshoot this further?
No need.
In true (and time proven) Linux fashion I found a way out.
ie: by doing it in a different manner.
For those interested, the whole explanation is here.
TL;DR
For whatever reason, it seems the problem of getting the/a zram script to start in /etc/init.d has been doing the rounds for a while.
I could not find out why.
The solution is to start zram, setting the parameters and the zramswap file directly from rc.local.
And Bob's your uncle.
To test, I just dropped in the lines posted but (just to be neat) I'll write up a short script as a replacement for that.
Best,
A.
Offline
you could also give my https://github.com/eylles/zram-service script a try, it just works perfectly on my machine, also i'm planning to make it have some feature parity with what the rust-systemd-zram-generator so that it can also do mounts not just a single zram device as zramswap.
Offline
Hello:
... my https://github.com/eylles/zram-service script ...
Yes, I saw it.
But this is for an undepowered (Intel Atom N280/2Gb) ca. 2009 netbook for which I need a simple/easy solution.
The zramctl command can set up all the parameters I need in a jiffy in case the default ones are not suitable or I want to experiment.
Thanks for your input.
Best,
A.
Offline
As another option I've ported the zramen script from Void Linux to Devuan. It comes with a working init script for Daedulus.
Offline
Hello:
... ported the zramen script from Void Linux ...
... comes with a working init script for Daedulus.
Thanks for doing that for the team Dev1.
Best,
A.
Offline
No problem. Its not actually in Devuan repos as I'm not sure how to propose it. It may have to first be enabled by you if I remember correctly. I am currently on PCLOS, not Devuan.
Offline
Hello:
... not actually in Devuan repos ...
... not sure how to propose it.
... be enabled by you ...
No, not me. 8^D!
I'm just an interested observer.
That would be one of the admins (@golinux / @fsmithred / @Ralph.Ronnquist).
But I don't know what the process is / entails.
Best,
A.
Last edited by Altoid (2025-05-20 21:22:27)
Offline
By enabled I meant that the init script does not start automatically if I remember correctly. You have to enable it with update-rc.d.
Offline
Hello:
... meant that the init script does not start ...
... enable it with update-rc.d.
Right ... 8^°
Sorry, my bad.
Yes, update-rc.d uses the INIT INFO fields and is mandatory when adding a script to /etc/init.d.
Best,
A.
Offline