Linux change tmp directory

Changing MySQL temporary directory in Ubuntu

I can access a NULL pointer and I define the behavior!

If you want to change the directory that the MySQL server uses to create and store temporary files (usually the default directory is /tmp), you must set the tmpdir option, either by by putting a line like

in the MySQL config file (located in Ubuntu at /etc/mysql/my.cnf) under the [mysqld] section, or by starting the MySQL server with one of the —tmpdir=/new/tmp/dir or -t /new/tmp/dir command line options.

Note that the MySQL server (running with the mysql user and group) must have read and write permissions to the new tmpdir, otherwise you will get a /usr/sbin/mysqld: Can’t create/write to file ‘/new/tmp/dir/ibpgdyOX’ (Errcode: 13) error. There are two ways to give the mysql user permissions:

  1. Change the owner user and group of the folder to mysql: # chown mysql:mysql /new/tmp/dir . This option is useful when only the MySQL server will use the folder.
  2. Make the folder world readable and writable: # chmod 1777 /new/tmp/dir . Note that this command also sets the sticky bit on the directory. This is a security measure, and it means that files and folders in this directory can be unlinked or removed only by their owners. This option is useful when multiple processes will use the path as a temporary directory.

If after giving correct permissions on the new tmpdir to the mysql user, you still get the (Errcode: 13) error, and the new tmpdir is not a standard temporary directory (such as /tmp or /var/tmp), this may be caused by AppArmor (which is enabled by default since Ubuntu 7.10) not giving the MySQL server access rights to the tmpdir.

To fix this, you must modify the MySQL security profile located at /etc/apparmor.d/usr.sbin.mysqld. Add the lines:

/new/tmp/dir rw, owner /new/tmp/dir/** rwkl, 

The first line gives read(r) and write(w) access to the folder, the second line gives read(r), write(w), lock(k) and link(l) access to all the files and folders inside the folder owned by the mysql user.
To apply the changes, restart AppArmor with # service apparmor restart

Читайте также:  Changing drive in linux

Note that the tmpdir option accepts multiple paths (separated by «:» on Unix/Linux and «;» on Windows, documentation). If you specify multiple paths, you must apply the procedures above for each component.

Written By

I can access a NULL pointer and I define the behavior!

Published on October 10, 2015

Источник

How to set the TMPDIR environment variable to another directory?

./configure —enable-libmp3lame —enable-libvorbis —disable-mmx —enable-shared Unable to create and execute files in /tmp. Set the TMPDIR environment variable to another directory and make sure that it is not mounted noexec. Sanity test failed. If you think configure made a mistake, make sure you are using the latest version from SVN. If the latest version fails, report the problem to the ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file «config.err» produced by configure as this will help solving the problem.

My case: PKG_CONFIG_PATH=»$HOME/ffmpeg_build/lib/pkgconfig» ./configure —prefix=»$HOME/ffmpeg_build» —extra-cflags=»-I$HOME/ffmpeg_build/include» —extra-ldflags=»-L$HOME/ffmpeg_build/lib -ldl» —bindir=»$HOME/bin» —pkg-config-flags=»—static» —enable-gpl —enable-nonfree —enable-libfdk_aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 Unable to create and execute files in /tmp. Set the TMPDIR environment variable to another directory and make sure that it is not mounted noexec. Sanity test failed.

2 Answers 2

I was able to get it done using that code bellow:

$ export TMPDIR=~/tmp-ffmpeg $ mkdir $TMPDIR $ ./configure \ --enable-gpl \ --enable-version3 \ --enable-shared \ --enable-nonfree \ --enable-postproc \ --enable-libfaac \ --enable-libmp3lame \ --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --enable-libtheora \ --enable-libvorbis \ --enable-libvpx \ --enable-libx264 \ --enable-libxvid \ --enable-x11grab \ --extra-cflags="-I/usr/local/include" \ --extra-ldflags="-L/usr/local/lib" $ make $ make install $ rm -rf $TMPDIR $ unset TMPDIR 

There is also mktemp(1) command. So that you can set TMPDIR as follows:

$ TMPDIR="$(mktemp -d -q ~/tmp/tmp.XXXXX)" $ echo $TMPDIR /home/marcelo/tmp/tmp.I8V9H 

This should work for GNU coreutils as well as for BSD (macOs, FreeBSD, etc). Also note, you not need to export TMPDIR and then unset it. Instead try to pass variable directly to configure:

$ TMPDIR="/foo/bar/baz" ./configure . 

Hope it helps somebody else 😉

Источник

Thread: How to change /tmp directory? (not in fstab)

kung fu buntu is offlineWay Too Much Ubuntu

How to change /tmp directory? (not in fstab)

I’m having problems with available disk space so I need to change the location of my /tmp directory.
One of the reasons is that K3B seems to need 4GB of free space to verify the burn operation.

If I had my /tmp in fstab it would be easy, but I don’t, so I don’t know how can I do it.
I’ve tried booting as single user and making a link, but I got a «device is busy» error.

Читайте также:  Arping linux все команды

bodhi.zazen is offlineWalking moon

Join Date Apr 2006 Location Montana Beans 28,827 —> Beans Hidden! Distro Kubuntu Development Release

Re: How to change /tmp directory? (not in fstab)

change the location in what way ?

did you make a new partition ?

Or do you have a new directory ?

If you are using a new directory, use mount —bind

You need to set the proper permissions of /tmp

sudo chown root.root /tmp sudo chmod 1777 /tmp

There are two mistakes one can make along the road to truth. not going all the way, and not starting.
—Prince Gautama Siddharta

Kissell is offlineDipped in Ubuntu

Re: How to change /tmp directory? (not in fstab)

What I meant to do, was «chmod 770 folder_name -R» to a folder I created at /

What I did (after messing with windows machines all night) was «chmod 770 folder_name *» oops. that changed the folder permissions to all the folders in the root of the OS. where’s my undo button?

I thought I had changed everything back, but didn’t know about the 1777 trick for /tmp. Gnome wouldn’t load up a GUI interface for any user without doing that. Thanks!

I learned something today, unfortunately it was about how to set permissions on tmp and not about reading whats typed in / before hitting ENTER.

lakitu is offlineSpilled the Beans

ExclamationRe: How to change /tmp directory? (not in fstab)

i just did the above suggestion, & it nuked my ubuntu. i had to live cd gksu gedit my fstab back to before that line —

it kind of seems to be working, but i’m wondering (in ubuntu 10.10) *what do i need to do to restore from doing the above commands* — did you mean /new instead of /tmp zazen?

is there anything i need to undo? i undid the fstab line.

please pardon any incorrect etc info AS i have aphasia — sorrys

EDIT: for one my file manager won’t open — kind of a big problem.

Источник

How do I get to tmp folder in Linux terminal? Quick Shortcut

Most temporary files end in .TMP, which is commonly known as a “temp file” extension. Many different applications may produce temporary files, even though they all have the same file extension. You may not know which software created a certain temp file or where it originated.

To get to the tmp folder, you have to follow steps like opening the file manager and getting to the tmp folder or opening the terminal and typing cd /tmp. Where you can find all the temp files related to software, you will not be able to see which file belongs to which software, so check which you are deleting.

Читайте также:  Точка монтирования linux ubuntu

How do I get to tmp folder in Linux terminal?

You may figure out where a file came from by looking at the filename section before the extension. It’s possible that a Word or Excel spreadsheet called “2022 annual report” has the filename 2022 annual report .tmp.

In certain cases, the location of a temporary file might help you identify the source of a file. If you discover it, it’s more probable that a temporary file is located in the “Temporary Files” subfolder of a certain application’s main folder.

While browsing your computer’s hard disc, you may stumble upon temporary files. All operating systems automatically create temp files. The temp folder is where you’ll generally find them. Files called “temporary” are what they sound like: they’re used to store data that is only needed for a short period. Your computer will function more smoothly when you utilize apps or actions that need these files. Files with the .temp extension are also known as “foo files.”

When you’re working on a piece of media, whether a video, a photo, or a portion of prose, you’ll be creating temporary files, in addition to making your software function more quickly and smoothly, these files also serve as a backup in case your system or program crashes for whatever reason.

Источник

[РЕШЕНО]/tmp монтирование в другое место.

shaman avatar

это достаточно сделать только один раз, когда tmp пустая. Симлинк в большинстве случаев вполне подойдёт, за исключением гипотетической возможности, что программа проверит, что /tmp не является каталогом и упрётся.

darkprof avatar

maxys146 avatar

Natrio
Как сделать? Это команда. Её легко выполнить из консоли, но чтобы впихнуть её выполнение в процедуру загрузки – придётся анализировать стартовые скрипты или проверять, может быть /tmp ещё не используется до запуска первого демона из DAEMONS. Тогда скрипт с этой командой достаточно будет вписать туда первым.

darkprof avatar

но зато он выдает ошибку при старте системы: Произошла проблема с сервером конфигурации . Дальше иксы грузятся и вроде работает нормально.

shaman avatar

Тогда остаются два выхода
– или как-то настраивать gconf, чтобы переориентировать его на настоящее расположение, то есть /home/tmp (только не спрашивайте меня, как это делается – не знаю) ;
– или мучаться с прикручиванием mount –bind в загрузку.
P.S.
man fstab о такой возможности молчит, однако гугл на эту тему выдал такой вариант:

#    /home/tmp /tmp none bind 0 0

Источник

Оцените статью
Adblock
detector