PHP 8.5.2
Preview: dphys-swapfile Size: 2.15 KB
//etc/init.d/dphys-swapfile

#!/bin/sh
# /etc/init.d/dphys-swapfile - automatically set up an swapfile
# author Neil Franklin, last modification 2006.09.15
# This script is copyright ETH Zuerich Physics Departement,
#   use under either modified/non-advertising BSD or GPL license

# this init.d script is intended to be run from rcS.d
#   must run after  mount  of  /var  which may only happen in  S35mountall.sh
#     for this reason we can not build swapfile until after  S35mountall.sh
#       so we also need to use  init.d start|stop  to swapon|off our file
#   and sensibly before the lots of stuff which may happen in  S40networking
#   so we run it as rcS.d/S37dphys-config

### BEGIN INIT INFO
# Provides:          dphys-swapfile
# Required-Start:    $syslog $remote_fs
# Required-Stop:     $syslog $remote_fs
# Should-Start:      $local_fs
# Should-Stop:       $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Autogenerate and use a swap file
# Description:       This init.d script exists so one does not need to have a fixed size
#                    swap partition. Instead install without swap partition and then run
#                    this, with file size (re-)computed automatically to fit the current
#                    RAM size.
### END INIT INFO

. /lib/lsb/init-functions

# get ready to work
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH

# what we are
NAME=dphys-swapfile

case "$1" in

  start)
    /bin/echo "Starting ${NAME} swapfile setup ..."

    # (re-)size/-generate (and also first time install)
    # this will produce output, so no -n in above echo
    /sbin/dphys-swapfile setup

    # as S35mountall.sh has already run, do this from here
    #   as there can be no swapon in /etc/fstab
    /sbin/dphys-swapfile swapon

    /bin/echo "done."
    ;;


  stop|default-stop)
    /bin/echo -n "Stopping ${NAME} swapfile setup ..."

    # as no swapon or swapoff in /etc/fstab, do this from here
    /sbin/dphys-swapfile swapoff

    /bin/echo ", done."
    ;;


  restart|reload|force-reload|status)
    /bin/echo "No daemon to (force-)re[start|load] or status check in ${NAME}"
    ;;


 *)
    /bin/echo "Usage: $0 {start|stop}"

    exit 1
    ;;

esac

exit 0

Directory Contents

Dirs: 0 × Files: 45

Name Size Perms Modified Actions
3.65 KB lrwxr-xr-x 2025-08-15 12:16:02
Edit Download
2.22 KB lrwxr-xr-x 2025-07-08 14:50:50
Edit Download
1.85 KB lrwxr-xr-x 2023-11-14 20:02:33
Edit Download
1.21 KB lrwxr-xr-x 2024-02-26 12:58:31
Edit Download
3.03 KB lrwxr-xr-x 2024-02-27 02:22:50
Edit Download
937 B lrwxr-xr-x 2024-06-05 13:46:49
Edit Download
896 B lrwxr-xr-x 2024-06-05 13:46:49
Edit Download
3.08 KB lrwxr-xr-x 2023-12-05 15:36:45
Edit Download
2.15 KB lrwxr-xr-x 2016-10-23 23:10:58
Edit Download
6.85 KB lrwxr-xr-x 2024-06-10 21:27:45
Edit Download
985 B lrwxr-xr-x 2025-03-17 11:36:12
Edit Download
1.48 KB lrwxr-xr-x 2025-02-11 08:52:16
Edit Download
1.45 KB lrwxr-xr-x 2024-02-26 12:58:31
Edit Download
2.00 KB lrwxr-xr-x 2024-04-18 10:06:53
Edit Download
3.40 KB lrwxr-xr-x 2024-04-01 06:55:32
Edit Download
6.27 KB lrwxr-xr-x 2025-12-04 10:46:13
Edit Download
4.47 KB lrwxr-xr-x 2025-04-28 07:08:08
Edit Download
2.41 KB lrwxr-xr-x 2025-02-11 08:52:16
Edit Download
1.80 KB lrwxr-xr-x 2025-09-05 13:01:22
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-12-30 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-12-30 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
1.35 KB lrwxr-xr-x 2024-03-21 13:42:02
Edit Download
760 B lrwxr-xr-x 2024-03-21 13:42:02
Edit Download
3.02 KB lrwxr-xr-x 2024-03-05 15:20:59
Edit Download
959 B lrwxr-xr-x 2024-03-24 15:35:54
Edit Download
5.20 KB lrwxr-xr-x 2024-05-09 07:08:08
Edit Download
3.04 KB lrwxr-xr-x 2025-07-30 19:03:47
Edit Download
1.57 KB lrwxr-xr-x 2024-01-09 13:42:30
Edit Download
4.31 KB lrwxr-xr-x 2024-04-12 17:09:41
Edit Download
1.19 KB lrwxr-xr-x 2021-02-18 08:51:15
Edit Download
3.96 KB lrwxr-xr-x 2025-07-21 15:58:50
Edit Download
1.54 KB lrwxr-xr-x 2024-01-09 20:31:44
Edit Download
2.04 KB lrwxr-xr-x 2024-02-11 13:20:32
Edit Download
1.36 KB lrwxr-xr-x 2024-02-12 17:50:35
Edit Download
1.28 KB lrwxr-xr-x 2024-04-09 14:02:37
Edit Download
4.46 KB lrwxr-xr-x 2023-11-25 12:25:37
Edit Download
2.70 KB lrwxr-xr-x 2021-10-19 09:04:11
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).