Changed path of /tmp folder is not reflected - linux

I changed path of temporary folder from /tmp to a new path. I made these changes in /etc/environment file. I added following lines.
TEMP="path to new folder"
TMPDIR="path to new folder"
But still /tmp folder is being used as temporary folder.
The reason I want to change the path is because size of /tmp volume is very less.
Any reason why changes wouldn't be reflected? Do I need to reboot the server?

You should probably put a symlink to the new directory if possible as so many apps and system processes are likely still looking for it.
ln -s /path/to/new/tmp /tmp

Related

chmod cannot access to 'uploads/' :file or folder doesn't exist

i did this
sudo chmod -R 775 uploads/
and got this
chmod cannot access to 'uploads/' :file or folder doesn't exist
Your command is syntactically correct. The reason why it is reporting file or folder doesn't exist will be that the file or folder doesn't exist.
As you are using a relative path, you may wish to ensure that the current directory when you type the command is the parent directory of where you expect the uploads directory to reside. Note in particular that sudo will run the chmod command from the existing current directory (for example, it would not change to the home directory of the root user merely because it is running the command as root).
If you wish to check whether uploads is a valid path relative to the current directory, then use the ls command (without command-line arguments) to list the contents of the current directory, and see whether uploads (case-sensitive) is mentioned in the output.

will coping files recursively from one directory to another lead to changes in one directory reflect in another directory files also?

If I copy files from one directory to another directory:
Will their inode numbers also change?
Changes in file of one directory, will it reflect in same file of another directory also?
When I use command like:
cp -r dir1/ dir2/
With a simple copy the file system handle the copied files as newly created ones, therefore assining new inodes to them.
Any change made in the origin wouldn't change the copys. This only happens when you create symbolic or hard links between files.
You can check the inodes of your files with "ls -i filename".

Unix Permission: different chmod on folder and its files

Say a FOLDER is set to chmod 777 but FILES in the folder is set to chmod 755.
Non-owner user can write files to the FOLDER. Then how about overwriting the already existing files? Can the existing files be overwritten by a non-owner user?
If you give everyone read, write, and execute permissions on a directory, everyone can create and remove files, including ones that have been created by other users.
If you want to avoid such a behavior (one of your comments mentioned that), you should create another /tmp or /var/tmp directory: Set the sticky bit:
$ chmod +t directory
With the sticky bit set, every user can create new files, but is unable to remove files from others.
A fair word of warning here though: I do not recommend to secure your uploads with such a feature. Implement a better access control in your frontend instead.
Yes. While non-owners will not be able to open a file for editing and change its contents, they will be able to remove any file in the directory and replace it with a new file of the same name.

How do I fix the uploading error in aptana studios: parent path doesn't exist

I have a quick question. I've been trying to upload my website to blue-host, but every time I try, it says that parent path doesn't exist, is there a way I can change the parent path so the uploads work
Thx,
willmonferno
This is likely due to file permissions, you don't have write access, try updating file owner or file permissions.
I'm guessing you on some type of linux system, so you either need a chown (change owner) shell command or a chmod command (change file permissions) on the parent folder
try:
sudo chmod -R 777 {YOUR_PARENT_FOLDER}
This will recursively change this and all other files and folders below it in the file tree to allow everything. I would change it once you're in a production environment.

How to change the temprary directory for configure script?

When I run the configure script to build GNU global on Linux system, I got the message "cannot create temp file for here document: No space left on device". Indeed, / disk was full.
So I tried to change temporary directory to another disk, and I set the environment variable TMPDIR, TMP, and TEMP to another disk directory, say /mnt/tmp.
I retried to run configure script, but I got the same message. What's wrong? Please give me any advice.
Thanks.
you could add the below statement at the beginning of your script.
export TMPDIR='DIRNAME'
where "DIRNAME" is any directory on which you have full permissions and has sufficient memory available in it
you can override the location of the temporary directory during configure like so:
./configure TMPDIR=path/to/your/tmp/folder
If your / directory is full, and the program is trying to write to your /tmp directory, try renaming the tmp directory to something like tmp_old, then create a symbolic link to your new tmp folder like: ln -s /mnt/tmp /tmp

Resources