The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change/Remove Securetmp

Discussion in 'General Discussion' started by mickalo, Jun 28, 2004.

  1. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Hello,

    what is the best way to either remove or make changes after running the /scripts/securetmp cpanel script ??

    TIA,
    Mickalo
     
  2. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Via SSH :D
     
  3. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Sorry I had to do it.

    Are you trying to change the size of the tmp partition?
     
  4. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    HA ;). . . . .

    What I was getting at is if I need to remove the partition created by the securetmp, if problems arise, or if I need to make changes the tmp partition size :)

    TIA,
    Mickalo
     
  5. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    You should be able to remove the

    /scripts/securetmp --auto

    entry from rc.local and reboot.
     
  6. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    what are you referring to here: entry from rc.local ??

    thx's
    Mickalo
     
  7. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    /etc/rc.local
     
  8. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    I assume this file needs to also be edited ??

    Mickalo
     
  9. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Now you are losing me. Here is the part of the script that asks if you would like securetmp to be run upon reboots:

    if ($ARGV[0] ne "--install") {
    print "Would you like to secure /tmp & /var/tmp at boot time? ";
    chomp($q = <STDIN> );
    } else {
    $q = 'yes';
    }
    if ($q =~ /^y/i) {
    if (-e "/etc/rc.d/rc.local") {
    open(RC,">>/etc/rc.d/rc.local");
    } else {
    my $setperm = 0;
    if (! -e "/etc/rc.local") { $setperm = 1; }
    open(RC,">>/etc/rc.local");
    if ($setperm) { chmod(0755,"/etc/rc.local"); }
    }
    print RC "\n\n#--Added by /scripts/securetmp--\n/scripts/securetmp --auto\n\n";
    close(RC);
    }

    If, when you ran securetmp, you said yes that you would like the script to run at boot time, then the following lines were added to either your /etc/rc.d/rc.local or /etc/rc.local files;

    #--Added by scripts/securetmp--
    /scripts/securetmp --auto

    If you remove those lines and reboot, it should be like you had answered no.
     
  10. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Ok, what I was getting at is if one runs the securetmp script and creates the new partition, but now needs to remove it entirely!... what is the command line syntax to remove it entirely... not just the boot up reference :)

    is this the correct command: umount -l /var/tmpMnt ?

    sorry about the confusion..... it's MONDAY ;)
    Mickalo
     
  11. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You have to be a little bit careful when doing this. Here are the steps that I would recommend:

    /etc/init.d/chkservd stop
    /etc/init.d/mysql stop

    umount /tmp
    umount /var/tmp

    Now, make sure that there is a /tmp directory at the top of / and a /var/tmp directly symlinked to /tmp. If not, create them - the permissions for a real /tmp directory need to be drwxr-xr-t

    Recreate the mysql lock symlink if it doesn't exist in /tmp:
    cd /tmp
    ln -s /var/lib/mysql/mysql.sock
    /etc/init.d/mysql start
    /etc/init.d/chkservd start

    Then remove the following line if found in /etc/rc.d/rc.local:
    #/scripts/securetmp --auto

    That should be it, no need to reboot. The thing that can bite you is making sure that there is a /tmp directory after umounting the virtual /tmp filesystem. If it doesn't exist, you can have problems rebooting the server.
     
    #11 chirpy, Jun 28, 2004
    Last edited: Jun 28, 2004
  12. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    thanx chirpy, this was the info I was looking for. I've been a bit leary about running this securetmp script, but wanted to make sure there is a way too remove it if necessary or problems arise later on.

    Mickalo
     
    postcd likes this.
  13. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    The script needs to be rerun at every reboot.

    Chirpy gave good instructions for removing the effects without rebooting (which may be preferred depending on your maintenance window). If you can afford to reboot, then simply removing the lines from the rc.local file and rebooting should take care of you.
     
  14. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    Ok, thx's, that's good to know also, appreciate all the help :)

    Mickalo
     
Loading...

Share This Page