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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 308B7C282DD for ; Wed, 8 Jan 2020 18:31:57 +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 EEAF6206DA for ; Wed, 8 Jan 2020 18:31:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="j8ApfHeG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="djn3eIdc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEAF6206DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com 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 1ipG7F-00010f-6e; Wed, 08 Jan 2020 13:31:37 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1ipG7C-00010H-42 for kernelnewbies@kernelnewbies.org; Wed, 08 Jan 2020 13:31:34 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 23FB8610; Wed, 8 Jan 2020 13:31:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 08 Jan 2020 13:31:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=KJup556O2KifDEq7RU+S8UxvJbM 9oLRobYgWmSvFQhA=; b=j8ApfHeGrnJmzVJzW7WcpR1wHK7WVtgWSnzK8N/eQl0 N7PYQgwg5vAHlYLLuqSThaVI0mCVD5IPC6VHQQ9dt0cRzvFBn1PeB/Y9Jhacf6Ke O55hTdQmQNdy5cPQVRVM4TWgCzx51Pf2ew+mGhSnMxA1xnUbj6ngwJvqs73kIVw9 qaeSz/NYMBstsbikx+qysUaZzofbUEEmEju3QYavDXSUuKk5i3y4sTCabhAYD0Er I0VYC3TZ+rHtu7JiY45K+2YmrNP9Uo2nxKccu3UStq1/DtmCNysFvrUz8B+OBTgy NWwMCT9EOlyd0gajBbzEbhso+nZYELFcr5rPOYVxLMQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=KJup55 6O2KifDEq7RU+S8UxvJbM9oLRobYgWmSvFQhA=; b=djn3eIdcdGcA9iGo5Hj6Sv 9qa1cAQCUNENs6cqy9wliy+IwiUp8C5Tu05cPAzJO4Ss3xwp3JKZoclM6Zf8bJSv kIn5D3m2Vs8AuCc+8BZ826ZmrqeTa+s7nDGtFjOf3LwEXKf8YoScI1ud72YK4/OV ES/4poWaXcc5FLodVQPazKq24z/657TvJEKWiGBWS6RgD04g3ss6e88a3EbV31mx 6pRJR5iUFas3Yn2Nu1f/pvFQbzAf0sjZLkGen+LhvURKKmWAZ72/cF4HqydQlqCu ogdd8/3FN1LSm3TQwdDEPtw9mkUyQgGoxPDsn/afZvgVxwWTexdTRh2qYVGD3G9g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehkedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhm qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 34A718005A; Wed, 8 Jan 2020 13:31:26 -0500 (EST) Date: Wed, 8 Jan 2020 19:31:23 +0100 From: Greg KH To: Jeffrey Walton Subject: Re: Alternate method of running swapon? Message-ID: <20200108183123.GC2549996@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Wed, Jan 08, 2020 at 01:09:23PM -0500, Jeffrey Walton wrote: > 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? Odds are the VPS provider is blocking it in the kernel they provide to you. You can always just try to write your own program that does the same syscalls that 'swapon' does, but I doubt that works. Perhaps spring for a bigger vm? greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies