Change /tmp for sequenceserver

Hello,

I am trying to change the default directory where sequenceserver writes file from /tmp to some folder in home directory.

I searched forum, and followed some instructions.

I tried to change config.ru file

cat /usr/local/share/gems/gems/sequenceserver-1.0.11/config.ru

require ‘sequenceserver’

def Dir.tmpdir

‘/home/AM_assembly/tmp’

end

SequenceServer.init

run SequenceServer

I also set $TMPDIR

But it didn’t help.

Could you advise something

sequenceserver -v

1.0.11

Thank you,
Nataliya

Hi Nataliya,

If you are launching SequenceServer from command line, the following works:

TMPDIR=/path sequenceserver

config.ru is relevant only if you are using SequenceServer with Apache. Your code does look like it should work. Alternatively, I have the following at the top of one of my old config.ru file:

ENV[’TMPDIR’]=/path

Note that temporary files are deleted once they have been used.

Priyam

Thank you Priyam,

unfortunately none of this worked

The temporary files are deleted indeed after sequence server stops, if pressing CTRL+C,
but I have sequence server in Autorun

cat /etc/systemd/system/multi-user.target.wants/sequenceserver.service

[Unit]

Description=SequenceServer server daemon

Documentation=“file://sequenceserver --help” “http://sequenceserver.com/doc

After=network.target

[Service]

Type=simple

User=AM_assembly

ExecStart=/usr/local/bin/sequenceserver -c /home/AM_assembly/.sequenceserver.conf

KillMode=process

Restart=on-failure

RestartSec=42s

RestartPreventExitStatus=255

[Install]

WantedBy=multi-user.target

I
so files stay in /tmp all the time until I delete them manually, for example
In /tmp

-rw------- 1 AM_assembly AM_assembly 1.8K Mar 31 19:36 sequenceserver_query20200331-69120-qm9hv9

-rw------- 1 AM_assembly AM_assembly 1.8K Mar 31 19:54 sequenceserver_query20200331-69120-qp5vjp

-rw------- 1 AM_assembly AM_assembly 843 Mar 31 19:19 sequenceserver_query20200331-69120-scj86d

-rw------- 1 AM_assembly AM_assembly 843 Mar 31 18:56 sequenceserver_query20200331-69120-zaj3p5

-rw------- 1 AM_assembly AM_assembly 0 Apr 1 06:46 sequenceserver_query20200401-69120-15as5ex

-rw------- 1 AM_assembly AM_assembly 0 Apr 1 08:53 sequenceserver_query20200401-69120-1hi4vi1

-rw------- 1 AM_assembly AM_assembly 0 Apr 1 06:47 sequenceserver_query20200401-69120-1sxk5dy

-rw------- 1 AM_assembly AM_assembly 4.0K Apr 1 10:19 sequenceserver_query20200401-69120-9jdv5c

-rw------- 1 AM_assembly AM_assembly 2.1K Apr 1 11:52 sequenceserver_query20200401-69120-h3o8zo

when some big searched are launched files can grow to Gbs and we ended up with no space in /

that’s why I am looking for possibility to change /tmp

What else I can try? Or maybe I am doing something wrong?

чт, 2 апр. 2020 г. в 10:35, Anurag Priyam <anurag08priyam@gmail.com>:

Is that a systemd unit file? What if you set TMPDIR environment variable using Environment directive:

Environment=TMPDIR=/path

That would go in the [Service] section.

See https://coreos.com/os/docs/latest/using-environment-variables-in-systemd-units.html

If that doesn’t work you can just create a little script, say ’sequenceserver.sh’, containing:

TMPDIR=/path sequenceserver -c …

And then change ExecStart to point to this script (absolute path).

If none of the above works, you can try to directly modify the code. There should be a lib folder next to the config.ru file you found earlier. Add the following at the top of lib/sequenceserver.rb

ENV[’TMPDIR’]=/path

Nope, nothing worked again :frowning: sorry

When I run from command line line
TMPDIR=/path sequenceserver -c …

it doen’t work also, it seems that it is not reading TMPDIR at all.
Where is directory for temporary file defined in the code? Where are the instruction to read $TMPDIR?

чт, 2 апр. 2020 г. в 12:29, Anurag Priyam <anurag08priyam@gmail.com>:

It is part of Ruby programming language’s standard library.

Priyam