https://github.com/eylles/zram-service
a simple zram setup script - alternative to zram tools
https://github.com/eylles/zram-service
init-script initscript service systemd systemd-service sysvinit zram zram-generator zram-swap
Last synced: 10 months ago
JSON representation
a simple zram setup script - alternative to zram tools
- Host: GitHub
- URL: https://github.com/eylles/zram-service
- Owner: eylles
- License: gpl-3.0
- Created: 2022-01-14T06:56:08.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T23:38:55.000Z (12 months ago)
- Last Synced: 2025-04-05T17:51:10.557Z (10 months ago)
- Topics: init-script, initscript, service, systemd, systemd-service, sysvinit, zram, zram-generator, zram-swap
- Language: Shell
- Homepage:
- Size: 73.2 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# ZRAM service
This is a simple script compatible to set up zram, it is an alternative
to [zram-tools](https://github.com/highvoltage/zram-tools) and
[zramswap](https://aur.archlinux.org/packages/zramswap)
This script depends on a posix shell interpreter, and core utilities, can
operate with just busybox if need be.
## why ?
Looked at other services and scripts for using zram and they were a mess to be
honest, some did too much others too little, this won't be the be all end all of
zram scripts and setups but so long as it serves most cases i am satisfied.
## installation
Install everything:
```sh
sudo make install-all
```
this will provide:
|component|default location|description|
|----|----|----|
|zrs|`/usr/local/sbin/zrs`|script that does the actual work of config parsing and zram setting|
|zram|`/etc/init.d/zram`|sysvinit initscript|
|zram.service|`/etc/systemd/system/zram.service`|systemd unit|
### install config
Edit the config.mk file to tweak installation options.
#### SysV init script
This repo provides 2 sysvinit init scripts, a hand written one and one that uses
Debian's init-d-script framework that provides a Debian and LSB compliant init.d
script that may be preferred on some environments, you can choose with the
config.mk file.
## Usage
### sysvinit
The makefile should put the script in `/etc/init.d/zram` by default, after that
a simple ```sudo update-rc.d zram defaults``` should be enough to activate
it for the next boot
The service script supports the start, stop, restart and status actions along
the init, end, stat and force-restart aliases.
A simple `sudo service zram start` will initiate the zram service.
### systemd
The makefile should put the unit in `/etc/systemd/system/zram.service` by
default, all you need is run ```sudo systemctl enable zram``` to activate the
service for the next boot.
Initiate the service with `sudo systemctl start zram`
## TODO
* add debian packaging "paperwork"
* perhaps add an action in the makefile to create a .deb