Issue with Setting Temporary Directory for Firebird 5 on Linux

87 views
Skip to first unread message

Ernesto Alconada

unread,
Nov 13, 2025, 4:52:40 AMNov 13
to firebird-support

I am trying to run Firebird 5 on a Linux system, and I have set the FIREBIRD_TMP system variable and modified the firebird.conf file to change both the TempDirectories and TempTableDirectory variables to the same value as FIREBIRD_TMP. However, these settings seem to be ignored, and Firebird continues to generate temporary files in /tmp.

My goal is to run multiple instances of Firebird, each with its own temporary directory. The problem is that /tmp is a RAM-mounted directory and is too small for my needs.

Has anyone encountered this issue or have any advice on how to correctly configure Firebird to use custom temporary directories?

SP Ooi

unread,
Nov 13, 2025, 10:48:24 AMNov 13
to firebird...@googlegroups.com
We have this same issue across our 14 FB5 servers too. Please share any solution.

SP
Sent from mobile device


--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/firebird-support/3f89d850-b0e4-4f14-b71e-5b8fa89ca346n%40googlegroups.com.

Hamish Moffatt

unread,
Nov 13, 2025, 5:38:19 PMNov 13
to firebird...@googlegroups.com
On 13/11/25 07:42, Ernesto Alconada wrote:
>
> I am trying to run Firebird 5 on a Linux system, and I have set the
> FIREBIRD_TMP system variable and modified the firebird.conf file to
> change both the TempDirectories and TempTableDirectory variables to
> the same value as FIREBIRD_TMP. However, these settings seem to be
> ignored, and Firebird continues to generate temporary files in /tmp.
>
> My goal is to run multiple instances of Firebird, each with its own
> temporary directory. The problem is that /tmp is a RAM-mounted
> directory and is too small for my needs.
>
>
As a workaround, you could always modify fstab not to have /tmp as
tmpfs. It wasn't always like that.

Or bind mount some real storage on to /tmp/firebird.


Hamish

SP Ooi

unread,
Nov 14, 2025, 1:21:05 AMNov 14
to firebird...@googlegroups.com
I believe the original issue was why did FIREBIRD_TMP system variable nor TempDirectories and TempTableDirectory in firebird.conf work? Was that a bug? If it was, would it be fixed?

Modifying fstab to mount another storage resource over /tmp/firebird (which /tmp was also mounted via fstab) is not an option.

Regards, SP



--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
--- You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.

Hamish Moffatt

unread,
Nov 14, 2025, 2:47:45 AMNov 14
to firebird...@googlegroups.com
On 14/11/25 17:20, SP Ooi wrote:
> I believe the original issue was why did FIREBIRD_TMP system variable
> nor TempDirectories and TempTableDirectory in firebird.conf work? Was
> that a bug? If it was, would it be fixed?


How did you set FIREBIRD_TMP for the server? Are you sure it's taking
effect? You can look in the output of

cat /proc/$(pidof firebird)/environ


Hamish

Vlad Khorsun

unread,
Nov 14, 2025, 3:06:37 AMNov 14
to firebird-support
  Memory mappings (shared memory) files such as lock table, TIP cache and snapshots lists, monitoring snapshots, etc, 
must be placed into common, well known place to ensure ability to correct communication between server processes. 
It should be known in advance - before connect to the any database. This place is /tmp/firebird by default and could be 
changed by setting FIREBIRD_LOCK environment variable. It is highly not recommended to do as it may lead to corrupted 
database(s), if use improperly. 

  If you really going to set  FIREBIRD_LOCK after warning above - do it system-wise, not "per-database".

Regards,
Vlad

Dimitry Sibiryakov

unread,
Nov 14, 2025, 3:10:51 AMNov 14
to firebird...@googlegroups.com
'Hamish Moffatt' via firebird-support wrote 13.11.2025 23:38:
> As a workaround, you could always modify fstab not to have /tmp as tmpfs.

Better would be to back up tmpfs with some swap files.

--
WBR, SD.

Ernesto Alconada

unread,
Nov 14, 2025, 10:04:02 AMNov 14
to firebird-support
 

I’m configuring the FIREBIRD_LOCK and FIREBIRD_TMP environment variables at the database server level, by setting them in the Firebird service configuration file with the desired values. Additionally, I’ve set the PrivateTmp variable to yes so that each Firebird service (since I have multiple instances installed) uses its own directory in /var/tmp. Here’s an example of the configuration file:

[Unit] Description=Firebird Database Server After=syslog.target network.target Documentation=https://firebirdsql.org/en/firebird-rdbms/ [Service] User=firebird Group=firebird Type=forking ExecStart=/opt/firebird_caiconta/bin/fbguard -daemon -forever PrivateTmp=yes Environment=FIREBIRD_TMP=/var/tmp Environment=FIREBIRD_LOCK=/var/tmp [Install] WantedBy=multi-user.target

Is this setup correct? If I were to configure it system-wide, would there be any issue with sharing the same directory for multiple Firebird services?

Thanks

Ernesto Alconada

unread,
Nov 14, 2025, 10:05:33 AMNov 14
to firebird-support
Configuration service file:

[Unit]
Description=Firebird Database Server
After=syslog.target network.target


[Service]
User=firebird
Group=firebird
Type=forking
ExecStart=/opt/firebird_caiconta/bin/fbguard -daemon -forever
PrivateTmp=yes
Environment=FIREBIRD_TMP=/var/tmp
Environment=FIREBIRD_LOCK=/var/tmp

[Install]
WantedBy=multi-user.target

Vlad Khorsun

unread,
Nov 14, 2025, 3:01:16 PMNov 14
to firebird-support

I’m configuring the FIREBIRD_LOCK and FIREBIRD_TMP environment variables at the database server level, by setting them in the Firebird service configuration file with the desired values. Additionally, I’ve set the PrivateTmp variable to yes so that each Firebird service (since I have multiple instances installed) uses its own directory in /var/tmp. Here’s an example of the configuration file:

[Unit] 
Description=Firebird Database Server 
After=syslog.target network.target 
[Service] 
User=firebird 
Group=firebird 
Type=forking 
ExecStart=/opt/firebird_caiconta/bin/fbguard -daemon -forever 
PrivateTmp=yes 
Environment=FIREBIRD_TMP=/var/tmp 
Environment=FIREBIRD_LOCK=/var/tmp 
[Install] 
WantedBy=multi-user.target

Is this setup correct?

  Not completely. Embedded connections will still use default place for shared memory files.
Also, Firebird server could be run not as a system service. I can't consider nor recommend this aproach as completely safe.

If I were to configure it system-wide, would there be any issue with sharing the same directory for multiple Firebird services?

  No issues. Single folder for all memory mapped files is the natural way Firebird works.

Regards,
Vlad
 

Ernesto Alconada

unread,
Nov 14, 2025, 7:59:31 PMNov 14
to firebird...@googlegroups.com

I'm trying to configure the temporary directory system-wide for Firebird so that all services use the same location. However, no matter what I try, the service keeps creating its temporary files under /tmp/firebird.

How should I correctly define the variable so that it applies system-wide to all Firebird services? I’ve tried several methods, but the service still ignores them and uses the default path.


--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.

Hamish Moffatt

unread,
Nov 15, 2025, 11:22:19 PM (13 days ago) Nov 15
to firebird...@googlegroups.com
On 15/11/25 11:59, Ernesto Alconada wrote:

I'm trying to configure the temporary directory system-wide for Firebird so that all services use the same location. However, no matter what I try, the service keeps creating its temporary files under /tmp/firebird.

How should I correctly define the variable so that it applies system-wide to all Firebird services? I’ve tried several methods, but the service still ignores them and uses the default path.


These can't be from the server since you set PrivateTmp=yes in there. Are they from the client? Are you using the embedded server (in the client) to access any databases?


Hamish

Vlad Khorsun

unread,
Nov 17, 2025, 11:25:25 AM (12 days ago) Nov 17
to firebird-support

I'm trying to configure the temporary directory system-wide for Firebird so that all services use the same location. However, no matter what I try, the service keeps creating its temporary files under /tmp/firebird.

  Did you restart services ? Whole machine ? How these files names looks like ?

  Check the actual lock file path with following command:

  fbsvcmgr inet://localhost:port/service_mgr info_get_env_lock
 
where "port" is the value of RemoteServicePort setting of given Firebird instance.

How should I correctly define the variable so that it applies system-wide to all Firebird services? I’ve tried several methods, but the service still ignores them and uses the default path.


  It depends on your Linux distro. 

Regards,
Vlad
 
Reply all
Reply to author
Forward
0 new messages