Bitcoin Forum
December 18, 2017, 12:19:42 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: someone who knows centOS 6 please help me.  (Read 648 times)
kodtycoon
Hero Member
*****
Offline Offline

Activity: 812


View Profile
December 28, 2014, 02:51:48 AM
 #1

yes i know this if totally off topic but please dont shoot me. im on the very last hurdle after a 24 hour binge of learning linux from scratch to do this so im way too tired to set up an account anywhere else to post the problem. (mods move this to where ever appropriate if needed)

im configuring a server and im using these lines of code:

Code:
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D OUTPUT 1
iptables -D FORWARD 1

iptables -I INPUT 1 -p tcp --dport 7890 -j ACCEPT
iptables -I OUTPUT 1 -p tcp --dport 7890 -j ACCEPT
iptables -I FORWARD 1 -p tcp --dport 7890 -j ACCEPT

yum install java-1.8.0-openjdk-headless.x86_x64

           sudo dd if=/dev/zero of=/swapfile bs=2048 count=512k

sudo mkswap /swapfile
sudo swapon /swapfile

sudo nano /etc/fstab
<inserted> swap     /swapfile    swap     defaults      0 0

sudo nano /etc/sysctl.conf
<inserted> vm.swappiness=10

the code goes in fine, but after reboot of the server, swappiness is still at 10. /swapfile is still saved in /fstab, java is still on it as are the iptable settings, but the swap disk(indented line) vanishes ie when i do "swapon -s" nothing is there. isnt saving /swapfile into /fstab and/or setting vm.swappiness=10 supposed to make it permanent?
1513556382
Hero Member
*
Offline Offline

Posts: 1513556382

View Profile Personal Message (Offline)

Ignore
1513556382
Reply with quote  #2

1513556382
Report to moderator
1513556382
Hero Member
*
Offline Offline

Posts: 1513556382

View Profile Personal Message (Offline)

Ignore
1513556382
Reply with quote  #2

1513556382
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
moni3z
Hero Member
*****
Offline Offline

Activity: 887



View Profile
December 28, 2014, 03:42:19 AM
 #2

yes i know this if totally off topic but please dont shoot me. im on the very last hurdle after a 24 hour binge of learning linux from scratch to do this so im way too tired to set up an account anywhere else to post the problem. (mods move this to where ever appropriate if needed)

im configuring a server and im using these lines of code:

Code:
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D INPUT 1
iptables -D OUTPUT 1
iptables -D FORWARD 1

iptables -I INPUT 1 -p tcp --dport 7890 -j ACCEPT
iptables -I OUTPUT 1 -p tcp --dport 7890 -j ACCEPT
iptables -I FORWARD 1 -p tcp --dport 7890 -j ACCEPT

yum install java-1.8.0-openjdk-headless.x86_x64

           sudo dd if=/dev/zero of=/swapfile bs=2048 count=512k

sudo mkswap /swapfile
sudo swapon /swapfile

sudo nano /etc/fstab
<inserted> swap     /swapfile    swap     defaults      0 0

sudo nano /etc/sysctl.conf
<inserted> vm.swappiness=10

the code goes in fine, but after reboot of the server, swappiness is still at 10. /swapfile is still saved in /fstab, java is still on it as are the iptable settings, but the swap disk(indented line) vanishes ie when i do "swapon -s" nothing is there. isnt saving /swapfile into /fstab and/or setting vm.swappiness=10 supposed to make it permanent?

I don't use CentOS but https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6
/etc/fstab seems it should be:

/swapfile          swap            swap    defaults        0 0

edit: man fstab confirms digital ocean guide is correct http://linux.die.net/man/5/fstab
Flashman
Hero Member
*****
Offline Offline

Activity: 518


Hodl!


View Profile
December 28, 2014, 03:51:30 AM
 #3

No linux guru, just a meddler, but two thoughts, don't you have to mount it? annnd not sure if you're complaining of lack of swapping to swapfile, which might not happen until you run out of RAM.

TL;DR See Spot run. Run Spot run. .... .... Freelance interweb comedian, for teh lulz >>> 1MqAAR4XkJWfDt367hVTv5SstPZ54Fwse6

Bitcoin Custodian: Keeping BTC away from weak heads since Feb '13, adopter of homeless bitcoins.
Flashman
Hero Member
*****
Offline Offline

Activity: 518


Hodl!


View Profile
December 28, 2014, 04:29:22 AM
 #4

Oh right, and it won't come back with swapon /swapfile ? because that is a non-persistent command needs to be run on boot.

TL;DR See Spot run. Run Spot run. .... .... Freelance interweb comedian, for teh lulz >>> 1MqAAR4XkJWfDt367hVTv5SstPZ54Fwse6

Bitcoin Custodian: Keeping BTC away from weak heads since Feb '13, adopter of homeless bitcoins.
Bitsky
Hero Member
*****
Offline Offline

Activity: 560


View Profile
December 28, 2014, 09:02:14 AM
 #5

Try that. You have an error in your fstab; and setting up iptables like this just calls for errors.

Code:
cp /etc/sysconfig/iptables /etc/sysconfig/iptables.org
cat << EOF > /etc/sysconfig/iptables
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp --icmp-type 0 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 7890 -j ACCEPT
COMMIT
EOF
service iptables restart

yum install java-1.8.0-openjdk-headless.x86_x64

echo "vm.swappiness = 10" > /etc/sysctl.conf
echo "swap                    /swapfile               swap    defaults  0 0" >> /etc/fstab
dd if=/dev/zero of=/swapfile bs=2048 count=512k
chmod 0600 /swapfile
mkswap /swapfile
swapon -va

reboot

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Bitsky
Hero Member
*****
Offline Offline

Activity: 560


View Profile
December 29, 2014, 08:52:32 AM
 #6

Don't run it as part of the normal boot process, because it will add entries to sysctl.conf and fstab each time.

And my bad, I forgot to correct the fstab line you had wrong, sorry Embarrassed I had the correct entry in my fstab where it works fine.
You shouldn't need any extra steps after that. Since it's in fstab it should come up right during boot.

Try this one:
Code:
/swapfile               swap                    swap    defaults  0 0
Check with "swapoff -va && swapon -va && swapon -s" if the swaps are activated and used

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!