linux – Why does this systemd service not run at the right time (loading encryption keys from a network drive which are required for lxc containers)?

In Debian with systemd, I use zfs and lxc. My zfs datasets are encrypted and their keys can be loaded from a network host via my /etc/zfs/zfs-load-key.sh script. My LXC containers are started by lxc.service.

Loading the keys requires the network up and running (otherwise I get the error “no route to host”) but lxc.service requires the keys to be loaded.

Sounds trivial, but isn’t. I created this file /etc/systemd/system/zfs-load-keyfile@.service:

(Unit)
Description=Load %I encryption keys from network host
DefaultDependencies=no
Before=zfs-mount.service lxc.service
After=zfs-import.target network-online.target
Requires=zfs-import.target
Wants=network-online.target

(Service)
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/zfs/zfs-load-key.sh %I

(Install)
WantedBy=zfs-mount.service lxc.service

and enabled them via:

systemctl enable zfs-load-keyfile@tank-dataset1.service
systemctl enable zfs-load-keyfile@tank-dataset2.service

For for some reason, my LXC containers do not start because the keys were not yet loaded, ALTHOUGH I have Before=... lxc.service!

Why does this service not run at the right time, i.e. after the network is up and before lxc?

How to fix it?

linux – Why does this systemd service not run at the right time?

In Debian with systemd, I use zfs and lxc. My zfs datasets are encrypted and their keys can be loaded from a network host via my /etc/zfs/zfs-load-key.sh script. My LXC containers are started by lxc.service.

Loading the keys requires the network up and running (otherwise I get the error “no route to host”) but lxc.service requires the keys to be loaded.

Sounds trivial, but isn’t. I created this file /etc/systemd/system/zfs-load-keyfile@.service:

(Unit)
Description=Load %I encryption keys from network host
DefaultDependencies=no
Before=zfs-mount.service lxc.service
After=zfs-import.target network-online.target
Requires=zfs-import.target
Wants=network-online.target

(Service)
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/zfs/zfs-load-key.sh %I

(Install)
WantedBy=zfs-mount.service lxc.service

and enabled them via:

systemctl enable zfs-load-keyfile@tank-dataset1.service
systemctl enable zfs-load-keyfile@tank-dataset2.service

For for some reason, my LXC containers do not start because the keys were not yet loaded, ALTHOUGH I have Before=... lxc.service!

Why does this service not run at the right time, i.e. after the network is up and before lxc?

How to fix it?

linux – Why does file traversal not working in this PHP file upload code?

I am using this script to upload file to the system with apache2 as server and php7.
If I provide filename as ../../../../tmp/data.png of uploaded file, then also the file gets uploaded to /var/up/data.png.

<?php                                                                                                                                                                                                                                 
    $errors = (); // Store errors here                                                                                                                                                                                                
                                                                                                                                                                                                                                      
    $fileName = $_FILES('the_file')('name');                                                                                                                                                                                          
    $fileSize = $_FILES('the_file')('size');                                                                                                                                                                                          
    $fileTmpName  = $_FILES('the_file')('tmp_name');                                                                                                                                                                                  
    $fileType = $_FILES('the_file')('type');                                                                                                                                                                                          
    $fileExtension = strtolower(end(explode('.',$fileName)));                                                                                                                                                                         
                                                                                                                                                                                                                                      
    if (isset($_POST('submit'))) {                                                                                                                                                                                                    
                                                                                                                                                                                                                                      
      if ($fileSize > 4000000) {                                                                                                                                                                                                      
        $errors() = "File exceeds maximum size (4MB)";                                                                                                                                                                                
      }

      if (empty($errors)) {
        $didUpload = move_uploaded_file($fileTmpName, "/var/up/". basename($fileName));

        if ($didUpload) {
          echo "The file " . basename($fileName) . " has been uploaded";
        } else {
          echo "An error occurred. Please contact the administrator.";
        }
      } else {
        foreach ($errors as $error) {
          echo $error . "These are the errors" . "n";
        }
      }

    }
    else{
        echo "Bruhh!";
        }
?>

I don’t understand why is this happening?

linux – Importing big MySQL Database

I am trying to import a 6GB database on RHEL7.
I have been reading for
Here are my main settings in my.cnf:

debug-info = TRUE
max_allowed_packet=8200M;
net_buffer_length=1000000M;
post_max_size=4096M
max_exection_time = 60 * 60;
upload_max_filesize=6000M
read_buffer_size = 2014K
connect_timeout = 1000000
net_write_timeout = 1000000
wait_timeout = 1000000
memory_limit=6000M

After changing my settings I restarted the mysql service and then

mysql> SHOW VARIABLES LIKE '%max%';
+------------------------------------------------------+----------------------+
| Variable_name                                        | Value                |
+------------------------------------------------------+----------------------+
| binlog_max_flush_queue_time                          | 0                    |
| ft_max_word_len                                      | 84                   |
| group_concat_max_len                                 | 1024                 |
| innodb_adaptive_max_sleep_delay                      | 150000               |
| innodb_change_buffer_max_size                        | 25                   |
| innodb_compression_pad_pct_max                       | 50                   |
| innodb_file_format_max                               | Barracuda            |
| innodb_ft_max_token_size                             | 84                   |
| innodb_io_capacity_max                               | 2000                 |
| innodb_max_dirty_pages_pct                           | 75.000000            |
| innodb_max_dirty_pages_pct_lwm                       | 0.000000             |
| innodb_max_purge_lag                                 | 0                    |
| innodb_max_purge_lag_delay                           | 0                    |
| innodb_max_undo_log_size                             | 1073741824           |
| innodb_online_alter_log_max_size                     | 134217728            |
| max_allowed_packet                                   | 4194304              |
| max_binlog_cache_size                                | 18446744073709547520 |
| max_binlog_size                                      | 1073741824           |
| max_binlog_stmt_cache_size                           | 18446744073709547520 |
| max_connect_errors                                   | 100                  |
| max_connections                                      | 151                  |
| max_delayed_threads                                  | 20                   |
| max_digest_length                                    | 1024                 |
| max_error_count                                      | 64                   |
| max_execution_time                                   | 0                    |
| max_heap_table_size                                  | 16777216             |
| max_insert_delayed_threads                           | 20                   |
| max_join_size                                        | 18446744073709551615 |
| max_length_for_sort_data                             | 1024                 |
| max_points_in_geometry                               | 65536                |
| max_prepared_stmt_count                              | 16382                |
| max_relay_log_size                                   | 0                    |
| max_seeks_for_key                                    | 18446744073709551615 |
| max_sort_length                                      | 1024                 |
| max_sp_recursion_depth                               | 0                    |
| max_tmp_tables                                       | 32                   |
| max_user_connections                                 | 0                    |
| max_write_lock_count                                 | 18446744073709551615 |
| myisam_max_sort_file_size                            | 9223372036853727232  |
| optimizer_trace_max_mem_size                         | 16384                |
| parser_max_mem_size                                  | 18446744073709551615 |
| performance_schema_max_cond_classes                  | 80                   |
| performance_schema_max_cond_instances                | -1                   |
| performance_schema_max_digest_length                 | 1024                 |
| performance_schema_max_file_classes                  | 80                   |
| performance_schema_max_file_handles                  | 32768                |
| performance_schema_max_file_instances                | -1                   |
| performance_schema_max_index_stat                    | -1                   |
| performance_schema_max_memory_classes                | 320                  |
| performance_schema_max_metadata_locks                | -1                   |
| performance_schema_max_mutex_classes                 | 210                  |
| performance_schema_max_mutex_instances               | -1                   |
| performance_schema_max_prepared_statements_instances | -1                   |
| performance_schema_max_program_instances             | -1                   |
| performance_schema_max_rwlock_classes                | 40                   |
| performance_schema_max_rwlock_instances              | -1                   |
| performance_schema_max_socket_classes                | 10                   |
| performance_schema_max_socket_instances              | -1                   |
| performance_schema_max_sql_text_length               | 1024                 |
| performance_schema_max_stage_classes                 | 150                  |
| performance_schema_max_statement_classes             | 193                  |
| performance_schema_max_statement_stack               | 10                   |
| performance_schema_max_table_handles                 | -1                   |
| performance_schema_max_table_instances               | -1                   |
| performance_schema_max_table_lock_stat               | -1                   |
| performance_schema_max_thread_classes                | 50                   |
| performance_schema_max_thread_instances              | -1                   |
| range_optimizer_max_mem_size                         | 8388608              |
| slave_max_allowed_packet                             | 1073741824           |
| slave_pending_jobs_size_max                          | 16777216             |
+------------------------------------------------------+----------------------+

70 rows in set (0.01 sec)

$ mysql -u user -p database_name < database_dump.sql –force –wait –reconnect

ERROR 2006 (HY000) at line 4432: MySQL server has gone away
ERROR 2006 (HY000) at line 4433: MySQL server has gone away
...
ERROR 2006 (HY000) at line 5707: MySQL server has gone away

[Hostpoco]★SSD Linux Reseller @ $5/m ★ cPanel/WHM ★ Free Domin & Softaculous ★ | Proxies-free

It’s time to Start your Own Hosting Business. If you have a large number of sites under your control, our Reseller Hosting is best for you. Reseller Hosting is the perfect flexible hosting solution for web designers, small to medium-sized companies, or large-scale personal users.

Our web hosting reseller packages come with great prices. Our Super and higher SSD Linux Reseller Hosting plans are hosted on pure SSD drive servers. The servers are built with some of the best solid-state drives on the market. This will give your sites the best possible speed and performance at a very affordable price.

Sign up now and take advantage of our SSD Linux Reseller Hosting plans.

MAIN FEATURES

• Ultra-Fast and Secure Platform
• Easy Management
• Softaculous
• Professionals, Web Designers & Developers are Welcome
• 99.9% Uptime Guarantee
• Free Migration
• cPanel & WHM
• Multiple Network Connections
• Free Domain Name
• FREE Data Migration
• Private Nameservers
• FREE Setup
• 24/7 Support
• Daily Backups
• 30 day Money Back Guarantee

=========================
Startup SSD Reseller
=========================
• Free Domain Name
• 22 GB Web Space
• Unlimited Bandwidth
• 10 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $5 /Monthly

=========================
Pro SSD Reseller
=========================
• Free Domain Name
• 55 GB Web Space
• Unlimited Bandwidth
• 25 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $8 /Monthly

=========================
Premium SSD Reseller
=========================
• Free Domain Name
• 75 GB Web Space
• Unlimited Bandwidth
• 40 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $12 /Monthly

=========================
Elite SSD Reseller
=========================
• Free Domain Name
• 120 GB Web Space
• Unlimited Bandwidth
• 60 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $14 /Monthly

More Info | Order Now
https://www.hostpoco.com/best-ssd-linux-reseller-web-hosting.php

Website Link: https://www.hostpoco.com/

If you have any questions please feel free to contact us.sales@hostpoco.com

[Hostpoco]★SSD Linux Reseller @ $5/m ★ cPanel/WHM ★ Free Domin & Softaculous ★

It’s time to Start your Own Hosting Business. If you have a large number of sites under your control, our Reseller Hosting is best for you. Reseller Hosting is the perfect flexible hosting solution for web designers, small to medium-sized companies, or large-scale personal users.

Our web hosting reseller packages come with great prices. Our Super and higher SSD Linux Reseller Hosting plans are hosted on pure SSD drive servers. The servers are built with some of the best solid-state drives on the market. This will give your sites the best possible speed and performance at a very affordable price.

Sign up now and take advantage of our SSD Linux Reseller Hosting plans.

MAIN FEATURES

• Ultra-Fast and Secure Platform
• Easy Management
• Softaculous
• Professionals, Web Designers & Developers are Welcome
• 99.9% Uptime Guarantee
• Free Migration
• cPanel & WHM
• Multiple Network Connections
• Free Domain Name
• FREE Data Migration
• Private Nameservers
• FREE Setup
• 24/7 Support
• Daily Backups
• 30 day Money Back Guarantee

=========================
Startup SSD Reseller
=========================
• Free Domain Name
• 22 GB Web Space
• Unlimited Bandwidth
• 10 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $5 /Monthly

=========================
Pro SSD Reseller
=========================
• Free Domain Name
• 55 GB Web Space
• Unlimited Bandwidth
• 25 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $8 /Monthly

=========================
Premium SSD Reseller
=========================
• Free Domain Name
• 75 GB Web Space
• Unlimited Bandwidth
• 40 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $12 /Monthly

=========================
Elite SSD Reseller
=========================
• Free Domain Name
• 120 GB Web Space
• Unlimited Bandwidth
• 60 CPanel Accounts
• Unlimited FTP Accounts
• Unlimited MySQL Databases
• Unlimited Email Accounts
• Unlimited Mailing Lists
• $14 /Monthly

More Info | Order Now
https://www.hostpoco.com/best-ssd-linux-…osting.php

Website Link: https://www.hostpoco.com/

If you have any questions please feel free to contact [email protected]

linux – failed to run a qtwayland compositor

I’m trying to run a qtwayland compositor but it fails and I get return to the login screen.

I checked the log file in ~/.local/share/sddm/wayland-session.log :

QML debugging is enabled. Only use this in a safe environment. Failed
to create wl_display (No such file or directory) qt.qpa.plugin: Could
not load the Qt platform plugin “wayland” in “” even though it was
found. qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could
not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could
be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

When I try to run it as a normal program it works fine, What is the problem?

linux – change the hostname for a given service

I have 2 services running on my server. The first python service is working as expected.

# netstat -tulpn  | grep LISTEN | grep 8888
tcp        0      0 0.0.0.0:8888            0.0.0.0:*               LISTEN      1057/python

The second node service has started but not accessible from browser at http://somesite.com:5601

# netstat -tulpn  | grep LISTEN | grep 5601
tcp        0      0 127.0.0.1:5601          0.0.0.0:*               LISTEN      4740/node

I guess if I can change 127.0.0.1 to 0.0.0.0 just like the first command then it should work. But I am not sure ho to change the host only for the second service. I started the second service using the command

sudo systemctl start kibana.service

I am using ARM processor if that matters.