
**Describe the unexpected behaviour**
Trying to install clickhouse in FreeBSD (pfsense firewall), following this [link ](https://clickhouse.com/#quick-start)

**How to reproduce**
1 - copy the ClickHouse file into pfsense from [here](https://builds.clickhouse.com/master/freebsd/clickhouse)
2 - chmod a+x ./clickhouse
3 - sudo ./clickhouse install

 **Which ClickHouse server version to use**
- 21.12.1.8928 (official build


**Error message and/or stacktrace**
Code: 107. DB::Exception: Cannot obtain path to the binary from /proc/self/exe, file doesn't exist. (FILE_DOESNT_EXIST) (version 21.12.1.8928 (official build))
![image](https://user-images.githubusercontent.com/14872281/148040641-26f23fc0-39e9-4dcd-97dc-860c9cdefb9b.png)


fs::create_directories(pid_path);
            
            fs::permissions(pid_path, fs::perms::owner_all | fs::perms::group_read | fs::perms::others_read, fs::perm_options::replace);
            changeOwnership(pid_path, user);
        }
        std::string command = fmt::format("{} --config-file {} --pid-file {} --daemon",
            executable.string(), config.string(), pid_file.string());
        if (!user.empty())
        {
            bool may_need_sudo = geteuid() != 0;
            if (may_need_sudo)
            {
                struct passwd *p = getpwuid(geteuid());
                
                if (p == nullptr || std::string(p->pw_name) != user)
                    command = fmt::format("sudo -u '{}' {}", user, command);
            }
            else
                command = fmt::format("su -s /bin/sh '{}' -c '{}'", user, command);
        }
        fmt::print("Will run {}\n", command);
        executeScript(command, true);
        
        size_t try_num = 0;
        constexpr size_t num_tries = 60;
        for (; try_num < num_tries; ++try_num)
        {
            fmt::print("Waiting for server to start\n");
            if (fs::exists(pid_file))
            {