YunoHost-Apps / squid3_ynh

Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more.
http://www.squid-cache.org/
GNU General Public License v2.0
4 stars 2 forks source link

cp: cannot create regular file '/etc/squid3/.': No such file or directory #2

Closed csolisr closed 6 years ago

csolisr commented 6 years ago

Upon attempting to install, the following error appears:

csolisr commented 6 years ago

For the record, there is an /etc/squid folder (without the 3) created upon installing Squid manually.

anmol26s commented 6 years ago

What is the yunohost version and what device you are using?

csolisr commented 6 years ago

Currently using an x86 VPS over Debian Jessie, YunoHost 3.2.1

csolisr commented 6 years ago

OK, so I softlinked /etc/squid3 to /etc/squid, which lets the instalation continue, but the following error appears:

anmol26s commented 6 years ago

Can you install squid 3 manually and see if squid 3 directory /etc/squid3 has config file?

csolisr commented 6 years ago

Yes, there is a directory named /etc/squid and a file inside called squid.conf

anmol26s commented 6 years ago

The squid3 should have /etc/squid3/ instead of /etc/squid. Can you tell the output of uname -a ?

csolisr commented 6 years ago

Linux azkware.net 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux

csolisr commented 6 years ago

My bad, it was actually Debian Stretch we were talking about.

csolisr commented 6 years ago

And yes, when installing squid3 specifically, the folder does have a config file.

anmol26s commented 6 years ago

This should actually install squid3 on debian stretch. https://github.com/YunoHost-Apps/squid3_ynh/blob/master/scripts/install#L57 Its good that you installed squid3 manually. Can you try installing the package after the manual install to see if the overwrite the squid3 config file. Otherwise you can purge squid and squid3 and see if the app install the squid3 correctly.

csolisr commented 6 years ago

At this moment, the installation does cause squid3 to be installed, but after that the installation still fails with the error Failed to restart squid3.service: Unit squid3.service not found. It's on one of the logs above.

anmol26s commented 6 years ago

Can you purge squid3 and reinstall the package and see if the service is set up? I think its happening because of the broken package.

csolisr commented 6 years ago
sudo apt-get remove --purge squid squid3 && sudo apt-get autoremove --purge
sudo yunohost app install squid3

Warning: Failed to restart squid3.service: Unit squid3.service not found.
Warning: !!
Warning:   squid3's script has encountered an error. Its execution was cancelled.
Warning: !!
Warning:
Info: The operation 'Install 'squid3' application' has failed ! To get help, please share the full log of this     operation using the command 'yunohost log display 20180927-184259-app_install-squid3 --share'
Warning: Failed to get status information via dbus for service squid3, systemctl didn't recognize this service ('NoSuchUnit').
anmol26s commented 6 years ago

Install squid3 manually and see why the squid3 service is failing. I am not able to reproduce it on my all debian stretch servers. It would be good to fix this.

csolisr commented 6 years ago

We might be getting to something here:

csolisr commented 6 years ago

Sep 27 19:42:34 azkware.net systemd[1]: Reloading LSB: Squid HTTP Proxy version 3.x. Sep 27 19:42:34 azkware.net squid[11081]: Reloading Squid HTTP Proxy configuration files. Sep 27 19:42:34 azkware.net squid[11081]: done. Sep 27 19:42:34 azkware.net systemd[1]: Reloaded LSB: Squid HTTP Proxy version 3.x. Sep 27 19:44:40 azkware.net systemd[1]: squid.service: Supervising process 10555 which is not our child. We'll most likely not notice when it exits. Sep 27 19:44:40 azkware.net systemd[1]: Reloading LSB: Squid HTTP Proxy version 3.x. Sep 27 19:44:40 azkware.net squid[15846]: Unable to open configuration file: /etc/squid/squid.conf: (2) No such file or directory Sep 27 19:44:40 azkware.net squid[15835]: FATAL: Unable to open configuration file: /etc/squid/squid.conf: (2) No such file or directory ... failed! Sep 27 19:44:40 azkware.net systemd[1]: squid.service: Control process exited, code=exited status=3 Sep 27 19:44:40 azkware.net systemd[1]: Reload failed for LSB: Squid HTTP Proxy version 3.x.

csolisr commented 6 years ago

From what it looks, /etc/squid/squid.conf is being actually deleted at a certain point...

anmol26s commented 6 years ago

Ok Remove softlink to /etc/squid3 and delete it. Then $ apt-get purge squid3 And finally $ yunohost app install --debug https://github.com/YunoHost-Apps/squid3_ynh/tree/only_squid

csolisr commented 6 years ago

After this the installation seems to be successful, with some warnings. However the system seems unable to connect to the proxy, probably because of a corporate firewall blocking it. That's an issue for another ticket though, so for now I'll mark this one as closed.

anmol26s commented 6 years ago

You can change the port port if you know which port is open in your corporate firewall. The server should be kept outside the firewall as yunohost has its own firewall for security. Thanks