From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E996C282DD for ; Wed, 8 Jan 2020 18:27:40 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDE9F20692 for ; Wed, 8 Jan 2020 18:27:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDE9F20692 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=petrovitsch.priv.at Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1ipG32-0000aH-AE; Wed, 08 Jan 2020 13:27:16 -0500 Received: from esgaroth.petrovitsch.at ([78.47.184.11] helo=esgaroth.tuxoid.at) by shelob.surriel.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.92.3) (envelope-from ) id 1ipG30-0000Zu-NW for kernelnewbies@kernelnewbies.org; Wed, 08 Jan 2020 13:27:15 -0500 Received: from [10.68.100.236] (h10-gesig.woeg.acw.at [217.116.178.11] (may be forged)) (authenticated bits=0) by esgaroth.tuxoid.at (8.15.2/8.15.2) with ESMTPSA id 008IQrCL001722 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Wed, 8 Jan 2020 19:26:54 +0100 Subject: Re: Alternate method of running swapon? To: noloader@gmail.com References: From: Bernd Petrovitsch Message-ID: <7f477e10-8e55-fd1b-bc89-5399ba90395f@petrovitsch.priv.at> Date: Wed, 8 Jan 2020 19:26:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------96AF732EAC1F4E777DB0DC11" Content-Language: en-US X-DCC-sonic-Metrics: esgaroth.tuxoid.at 1255; Body=2 Fuz1=2 Fuz2=2 X-Virus-Scanned: clamav-milter 0.97 at esgaroth.tuxoid.at X-Virus-Status: Clean Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernelnewbies-bounces@kernelnewbies.org This is a multi-part message in MIME format. --------------96AF732EAC1F4E777DB0DC11 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all! On 08/01/2020 19:09, Jeffrey Walton wrote: [...] > 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. Apparently you run too many (or too fat) programs;-) > Everything is an upsell with the VPS provider. >=20 > I'm trying to setup a swapfile during startup using Systemd but: >=20 > # swapon /swapfile > swapon: /swapfile: swapon failed: Operation not permitted >=20 > This may be useful: [... nope ....]=20 > 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? The swapon (and swapoff) command basically calls the swapon() syscall (and swapoff() syscall, respectively) and their manual page say the caller needs CAP_SYS_ADMIN capability which usually means being "root". Does it work in a root-shell? The man page says further under errors: ---- snip ---- EPERM: The caller does not have the CAP_SYS_ADMIN capability. Alternatively, the maximum number of swap files are already in use; see NOTES below. ---- snip ---- The notes below just talk about the maximum numbers of swapfile depending on the kernel version and activates features. If the kernel is built/provided by the VPS provider, there may be further limitations .... MfG, Bernd PS: I'm not guessing why .... --=20 "I dislike type abstraction if it has no real reason. And saving on typing is not a good reason - if your typing speed is the main issue when you're coding, you're doing something seriously wrong." - Linus Torvalds --------------96AF732EAC1F4E777DB0DC11 Content-Type: application/pgp-keys; name="pEpkey.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pEpkey.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQGNBFss+8cBDACpXlq0ZC9Qp8R+iFPx5vDPu12FpnmbbV8CwexVDchdizF2qz+A PFh12RrkE6yudI0r7peAIRePiSVYqv8XT82TpJM+tbTYk/MSQaPhcmz8jl1HaKv0 q8g5nKtr42qRsswU7Q2Sa6mWXaIdOisPYZ9eLZC9BDBhI/YrgdAwszyYJ1HUwNkp Dw5i4wW/SsIKrotCboYzbBjZfHbmDJr4dFYSoMg5jQVHD2Yz8fqNSoRyd7i/oicn 1bH/DjEkrmIu9YuptuHYmblpCRo5dLww7kgszNw12j8Iljp64uJ/uz5+asBUmRZM mGey82BB1DnIvy1v+GnbGWFIYy79/HeqdN+KbOgO/sXoqYKS5KJ6aSqWOLTQk6sv AnDN2PNF5jOB9ROCNwoQSH/YNEfMd/mQ5pGB0UJ4ykD0UnjW7DdXbVOwvwWzfHF7 HaZXB1NMpBzHxold3W19DThd4HECvXYZ6Au6p0WE8IfABS11CzbX7KJuD5Ua+xKG 3W05fMg5i0td2aMAEQEAAbQtQmVybmQgUGV0cm92aXRzY2ggPGJlcm5kQHBldHJv dml0c2NoLnByaXYuYXQ+iQHUBBMBCgA+AhsDBQsJCAcDBRUKCQgLBRYDAgEAAh4B AheAFiEEgDWyyHEwksebo557hUq7AhBHKGYFAl0HmCMFCQO7nFkACgkQhUq7AhBH KGZCIQv+Li5U6ZfZ21JJPPzcV4JOq9nzz5YvJpPBwOtDgiDfsJ1WuSjJD0KpeCLh nxeTnGM1PwdjtXBImstZfDOX/IH/iiNgWLNz80KKx03yH40tDTPthZ/x5DVIm8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KOEJfC2BpXZl/TbHURgkUG uRAw+WsFTlqW+OEbsXXnzdonz/K4YtKUHo/cc9os9Iv3xoAqwa7mSMe4vgvyuskI VEbyqtOXvKZ2UTQlBh1Etnkkg6uOfSFbWi7IN0fv8gjsImSCuhn9JKWSSMeKWeu0 +cleW5uRuVexv5nCfVzzye673X+knkcchyUZ40cD9OzME9JHCzAmDWmHobFqsemr +2umZxCGzqLttmILn61NdmQvmauDFjNw383ngbMbk4bhduaWWV5dDlXmbsi4bDk6 HCaskYsbEHXXoOmb/ts7lP6ifqvT1ZfuogJfn5bXv1Sm4IJubJ4S4ZYrLg2fKlWH GWMRJlAOV5swTOmw4Gk/PV6jR/ioZxRiZtSZK1Pkso0gbla+HLY4OCo68eafP66p H2CEDcqDEBnjApKnTO1a6DtRkQzEs0aLhvXwhvt/HL6/lXIVQA=3D=3D =3DGX6K -----END PGP PUBLIC KEY BLOCK----- --------------96AF732EAC1F4E777DB0DC11 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --------------96AF732EAC1F4E777DB0DC11--