Kernel Newbies archive on lore.kernel.org
 help / color / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Alternate method of running swapon?
Date: Wed, 8 Jan 2020 13:09:23 -0500
Message-ID: <CAH8yC8kg1uoLhddNxjFN=wM8Gg4cz4qS6Sq1KsuD7pK3mgZ3bw@mail.gmail.com> (raw)

Hi Everyone,

I work with an open source project. We have a VM but it is low-end.
The machine suffers OOM kills. We don't have access to /etc/fstab.
Everything is an upsell with the VPS provider.

I'm trying to setup a swapfile during startup using Systemd but:

    # swapon /swapfile
    swapon: /swapfile: swapon failed: Operation not permitted

This may be useful:

# command -v swapon
/sbin/swapon
# file /sbin/swapo
swapoff  swapon
# file /sbin/swapon
/sbin/swapon: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.32,
BuildID[sha1]=a4891bc4dcfc533c61d76aa3e69870ab35d90c89, stripped

My question is, is there a way to sidestep the restriction? Is it
possible to ask the kernel to use the swapfile without using the
command?

Thanks in advance.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 18:09 Jeffrey Walton [this message]
2020-01-08 18:23 ` Valentin Vidić
2020-01-08 18:33   ` Jeffrey Walton
2020-01-08 18:42     ` Valentin Vidić
2020-01-08 20:08       ` Jeffrey Walton
2020-01-08 20:28         ` Valentin Vidić
2020-01-08 18:26 ` Bernd Petrovitsch
2020-01-08 22:23   ` Jeffrey Walton
2020-01-08 18:31 ` Greg KH

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH8yC8kg1uoLhddNxjFN=wM8Gg4cz4qS6Sq1KsuD7pK3mgZ3bw@mail.gmail.com' \
    --to=noloader@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git