Answer the question
In order to leave comments, you need to log in
How to output systemctl response to terminal?
Worked earlier only with 6.5 version of CentOS. And here you need it on the 7th version of CentOS
As it turned out, the old command service httpd restart
left, another one came in its place. systemctl restart httpd.service
But on 6.5, the answer was displayed immediately in the terminal, but in the 7th version - no
Tell the teapot what needs to be done to see if this is after running the command?
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Answer the question
In order to leave comments, you need to log in
Show with what code the previous command ended
0 - OK
1 - ERROR
Show what is happening with the service in general, a piece of logssystemctl status <servicename>
use && or ||
e.g. systemctl restart httpd.service || echo "failed to restart"
or systemctl restart httpd.service && echo "daemon restarted"
Ho-ho. It also lacks normal output in systemd on restart.
Googled in due time, I didn’t see the output similar to the old Internet anywhere for systemd
. I use systemctl status in order to look at the results. A crutch, but I didn’t find another solution when I was looking, maybe someone will tell us both now, and if not, then do as I do.
well, usually if the error didn’t fall out, then everything is fine, otherwise systemctl status -l <service_name>. Get used to it, I also got used to it for a long time after 6 centos, then I even liked it
Try this
<?php
$id = 1;
$arrayName = 'tmpl_' . $id;
global ${$arrayName};
${$arrayName}[] = 'string';
var_dump(${$arrayName});
<?php
$id = 1;
$arrayName = 'tmpl_' . $id;
global $$arrayName;
($$arrayName)[] = 'string';
var_dump($$arrayName);
$GLOBALS['tmpl' . $id] = ",..,";
But in general, it's best to avoid using global variables.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question