
**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)


if (filesEqual(binary_self_path.string(), main_bin_path.string()))
            {
                already_installed = true;
                fmt::print("ClickHouse binary is already located at {} and it has the same content as {}\n",
                    main_bin_path.string(), binary_self_canonical_path.string());
            }
        }
        if (already_installed)
        {
            if (0 != chmod(main_bin_path.string().c_str(), S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP | S_IXOTH))
                throwFromErrno(fmt::format("Cannot chmod {}", main_bin_path.string()), ErrorCodes::SYSTEM_ERROR);
        }
        else
        {
            if (!fs::exists(bin_dir))
            {
                fmt::print("Creating binary directory {}.\n", bin_dir.string());
                fs::create_directories(bin_dir);
            }
            size_t available_space = fs::space(bin_dir).available;
            if (available_space < binary_size)
                throw Exception(ErrorCodes::NOT_ENOUGH_SPACE, "Not enough space for clickhouse binary in {}, required {}, available {}.",
                    bin_dir.string(), ReadableSize(binary_size), ReadableSize(available_space));
            fmt::print("Copying ClickHouse binary to {}\n", main_bin_tmp_path.string());
            try
            {
                ReadBufferFromFile in(binary_self_path.string());
                WriteBufferFromFile out(main_bin_tmp_path.string());
                copyData(in, out);
                out.sync();