Autofs/Automount in SmartOS (Solaris) - solaris

Faced with a trouble using Autofs in SmartOS.
I added single line in /etc/auto_master:
/- auto_share
Here is /etc/auto_share's content:
/Public -rw 10.0.1.20:/nfs/Public
10.0.1.20 is WD MyCloud NAS, that why /nfs/ needed.
Anyway, simple mount 10.0.1.20:/nfs/Public /Public_test works well, but after svcadm enable autofs && automount I see new folder /Public but ls /Public says No such file or directory.
I'm little bit confused, because same case works like a charm in Linux and OS X, but not in SmartOS. Am I missing something?
I tried also inderect share /root auto_share & Public 10.0.1.20:/nfs/Public and adding -fstype=nfs, but no luck.

Well, I just should to get more info about Solaris administration tools.
svcs -l autofs
gave me information that some services necessary for autofs are offline:
dependency require_all/none svc:/system/filesystem/local (online)
dependency require_all/restart svc:/milestone/name-services (online)
dependency optional_all/none svc:/network/nfs/client (disabled)
dependency require_all/restart svc:/network/rpc/bind (disabled)
So, a couple of commands...
svcadm enable svc:/network/rpc/bind
svcadm enable svc:/network/nfs/client
...and everything works like a charm.
Sorry for noob question) Hope this information will be useful for someone.

Related

Debian: where are services installed

I want edit raspberrypi-net-mods.service to copy a file, rather than move it.
How would I go about locating this please?
YOu can get the location of a systemd-unit via
systemctl status raspberrypi-net-mods.service
You shouldn't edit system-installed service-files directly.
Instead you can customize a service by adding configuration to /etc/systemd/system/
You probably want to read the documentation, e.g. man 5 systemd.unit

Disable a standard systemd service in Yocto build

I need to start my own systemd service, let's call it custom.service. I know how to write a recipe for it to be added and enabled on boot:
SYSTEMD_SERVICE_${PN} = "custom.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
However, it conflicts with one of the default systemd services - systemd-timesyncd.service.
Is there a nice preferred way to disable that default systemd service in my bitbake file even though the systemd_XX.bb actually enables it?
I can create a systemd_%.bbappend file to modify the systemd settings, but I can't locate the place where one service can be disabled leaving all others enabled.
The working solution I found is to remove the timesyncd altogether using
PACKAGECONFIG_remove = "timesyncd"
But I wonder if this is a appropriate way and if there is a way to just disable it, but leave in the system.
How about adding a .bbappend recipe for the conflicting service you want disabled. In it, you would add:
SYSTEMD_AUTO_ENABLE_${PN} = "disable"
If the system runs fine with the other package removed, then removing the package is a preferred solution. Fewer packages means a simpler system.
Usually you would set SYSTEMD_AUTO_ENABLE_${PN} = "disable" and that would let the service be part of image but disabled on boot. However for systemd which provides a lot of default service units this may not be a solution you might want to deploy. You could surgically delete the symlink in etc which will ensure that service is not started automatically on boot but the .service file is still part of image. So add following to systemd_%.bbappend file in your layer
do_install_append() {
rm -rf ${D}${sysconfdir}/systemd/system/sysinit.target.wants/systemd-timesyncd.service
}
There are other ways to disable this e.g. using systemd presets as described here
Use the systemd.preset — Service enablement presets and in particular following steps.
Create a .bbappend file meta-xxx/recipes-core/systemd/systemd_%.bbappend with this content:
do_configure_append() {
#disabling autostart of systemd-timesyncd
sed -i -e "s/enable systemd-timesyncd.service/disable systemd-timesyncd.service/g" ${S}/presets/90-systemd.preset
}
In my yocto-based Linux distribution (yocto zeus release) above steps are enough to disable the service which remains installed.
In the output distribution previous steps modify the file /lib/systemd/system-preset/90-systemd.preset.
After the modification, in that file, appear the row: disable systemd-timesyncd.service and this row substitutes the raw: enable systemd-timesyncd.service
At this link there are some information about the topic: systemd.preset — Service enablement presets.
Other useful.
I was not able to use SYSTEMD_AUTO_ENABLE_${PN} = "disable" in this context.
For other recipes (for example dnsmasq_2.82.bb) the previous assignment works correctly and I have used it to enable (or disable) a service in the yocto distribution.
I think the "official" way to do this is to have something like this somewhere in your project:
PACKAGECONFIG_append_pn-systemd = "--disable-timesyncd"
This does basically the same you already suggested. To simply not enable the service you have to do it manually since you can modify the auto enable only per recipe.

difference on production system

I have a ZF3 project with a controller which opens excel-files and compares them with an template which will be openened, too.
On my development notebook (xampp) everything works fine, at my production system (ubuntu) the phpspreadsheet causes errors (I think it is the one).
here a snippet from my code:
$fileName="./public/files/" . $fileName; //.\ neu
echo $fileName;
$template= new Spreadsheet();
$importdcl= new Spreadsheet();
$template= \PhpOffice\PhpSpreadsheet\IOFactory::load('./public/files/Template_DCL_final.xlsx');
$importdcl= \PhpOffice\PhpSpreadsheet\IOFactory::load( $fileName);
echo "filename geladen";
I already have the folders in non relative paths because basePath() doesn't work, it won't give any result.
The echo statement is just because the server log won't give any errors. On my development system I get the echo text on my production system the error seems to be at the load statements.
First question: How could I use relative paths in here?
Second question: How can I get an idea wether is something wrong with the spreadsheet class?
This is what composer loaded:
"phpoffice/phpspreadsheet" : "dev-develop",
Is it a problem, because it has this dev version? At this point I'm quite confused because I played with the pathes of the files, I changed the rights manually in the folder, I checked server logs and now I don't have any idea left.
Here the rights in the folder:
Any helpful suggestions appreciated.
Answer (hopefully) to the first question: if your application is based on ZendSkeletonApplication, then you can use paths relative to your application root (from index.php):
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(dirname(__DIR__));
So if your data files are located in <application root>/public/files, then you should be able to read them from controller/service/etc. using public/files/<file name> path. You can test it with eg. the file_exists function.
I’m unable to answer your second question, but here are some suggestions (OK, questions…):
what is the status code of your (production) server’s response?
Do you have read/write permissions to the data files from the server’s account (www-data?)?
Does phpspreadsheet depend on any PHP extensions? Do you have them installed on both your development machine and the server?
What PHP version is installed on the server? Do you or phpspreadsheet use any features that may be unavailable on that version?
Try running your project not through Apache, but with PHP’s builtin server (but don’t do it long-term) and try to reproduce the issue.

haproxy - which configuration files

I have an HAProxy install which was configured by someone who left the company. It runs on Ubuntu 10.04 and it seems to use 3 configuration files in the directory /etc/haproxy
haproxy.cfg
haproxy.http.cfg
haproxy.https.cfg
I don't see the point in using the haproxy.https.cfg file as I believe (in our configuration) it can all be configured from a single haproxy.http.cfg file but when I remove that httpS file it complains bitterly and refuses to run. My question
Is this the standard configuration haproxy uses or if not, I can't find a reference to the "S" file anywhere. Can anyone suggest how HAProxy concludes it should use it?
Thanks
The very answer to your question: your haproxy is simply launched with those three config files ( -f haproxy.cfg -f haproxy.http.cfg -f haproxy.https.cfg, maybe from /etc/init.d/haproxy but mileage varies depending on your distribution ).
If you remove the file, of course it will complain.
This is not particularly standard, but ain't bad either, it helps structuring the conf rather than having a very long file.
The task of the .https version will certainly be to redirect the https traffic towards a service that can handle HTTPS (stunnel or nginx usually), since haproxy cannot terminate ssl connections. (stunnel has to be patched, see on the haproxy page)
If you want you can merge those files into one or two, just find out how haproxy is launched (check for init.d or let us know which distribution) and fix it appropriately.
I believe that it is only /etc/haproxy/haproxy.cfg that is used by default.
This may be of use to you (1.4 configuration reference):
http://haproxy.1wt.eu/download/1.4/doc/configuration.txt

nestacms and webbynode rapp

I would like to deploy a nestacms blog on webbynode by using the webbynode gem as allways I do with rails. Altough Webbynode seem to support Sinatra and Rack application easily, I get a WARNING during deployment stating that the application will not run smoothly because it lacks a public folder:
WARNING: Missing public folder in your Rack app, it'll not run smoothly!
Actually the rapid application development (RAPP webbynode gem) sets the need of a public folder into the Nginx configuration:
server {
listen 80;
server_name super_duper_blog.webbyapp.com ;
root /var/rapp/super_duper_blog/public/;
passenger_enabled on;
}
Instead this is my nestacms config.ru:
require 'rubygems'
require 'bundler/setup'
Bundler.require(:default)
require 'nesta/app'
Nesta::App.root = ::File.expand_path('.', ::File.dirname(__FILE__))
run Nesta::App
It would be nice if the author and SO user Graham Ashton could jump in and help me. Anyway, how could I get around the problem?
UPDATE
After creating the project, with nesta new you nedd to:
Create a public folder manually
Add some content in it. Say for ex. humnans.txt and favicon.ico
git add . and git commit -m "added public with humans and favicon"
wn push
And your nestacms website will go on line at a private webbynode address (blog.webbyapp.com)
Then you can use wn changedns www.example.com to make your site available for the masses
I've never used webbynode, so I'm not sure quite how its set up. Have you seen the Nginx passenger install guide? Could be useful:
http://modrails.com/documentation/Users%20guide%20Nginx.html#deploying_a_rack_app
It says you need public/ and tmp/, so I'm inclined to believe it.
Did you try making these directories yourself? Does the site actually start up? How are you deploying your site to the webbynode?
All my Sinatra apps are deployed with Vlad (see http://effectif.com/articles/deploying-sinatra-with-vlad) which takes care of creating public/ and tmp/ for you. It also touches tmp/restart.txt (see the Passenger guide I linked to above) when you deploy a new version of the site if you tell it that you're using Passenger. Capistrano also works fine (and is more extensively documented these days).