1. Beatrix Willius
  2. Valentina Server
  3. Samstag, März 28 2020, 09:56 AM
  4.  Abonnieren via E-Mail
How do I use both Server.Restart and Server.Shutdown?

I'm testing those commands in the example ValentinaServerUtility. Both don't do anything. Using latest version of Valentina Server on High Sierra. The screenshot is from immediately after clicking the shutdown button. Restart also doesn't seem to do anything.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Screenshot was too large. Trying again.
Anhänge
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
For Restart - you should see in the vServer log that all connections were dropped, vServer restarts every "internal" services and states. But it would not affect pref.panel, since there is no new log file, there is still the same vServer process ID and so on. In other words it restarts internally.

For Server.Shutdown - vServer process must be finished. But, look at

/Library/LaunchDaemons/com.paradigmasoft.vserver_x64.plist



...
<key>KeepAlive</key>
<true/>


It means new instance of vServer will be started if the vServer's process gone. You can not stop vServer without unloading this plist

Something like

launchctl bootout system /Library/LaunchDaemons/com.paradigmasoft.vserver_x64.plist


But you should see at least increased logs' count after Server.Shutdown
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Thanks for the information, Ivan.

Restart: yes, I can see the log files in Valentina Studio. The restart is done. However, when I try to change a server property then property isn't changed after the restart.

In the server utility:

- Click on Connect
- Change any property. For instance change the Max Client Timeout to 30. Click on the Set button.
- Click on Restart.
- Max Client Timeout is changed back to 20.

Is this the correct usage of restart?

- Shutdown: sorry, that isn't very useful. I know how to use the stop_me.sh script with launchctl unload.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
@Francois Van Lerberghe: yes, my problems on macOS seem similar to yours. What use is a shutdown command if it doesn't do anything? What happens for you when you do the restart command on Windows? Are the properties saved?
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
mValentinaServer.SetVariable seems to be working well : the new value is stored in the ini file.

But the restart command freeze the server app (as explained in the bug report ID #8756 for the shutdown command).
As I can see in the log file, the server is trying to terminate endlessly but is failing so ("Terminating the connection : FAILED";) and the log file is rapidly growing...
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Interesting. That's not what I see. The variables aren't set. Which becomes evident when after restarting the old variable values are loaded.
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
On MacOS side (Mojave 10.14.6, Valentina 10.1), mValentinaServer.SetVariable (tried on MaxClientTimeout) is working well too (=correctly set as on Windows side). The ini file is changed.
The restart or shutdown command (mValentinaServer.Restart) is working well here on MacOS.
I can see it in the Log folder : a new log file is created each time. Secondly, I must allow the app in the firewall each time too (as, I think, my custom* Valentina server app is not signed).
Not tried with the pref pane.

*I've changed the app name, exe name (and the ini file name) and reflected in the plist file with a custom name.
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
Forget to say : ValentinaServerUtility complied with Xojo 2019r1.1
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Very odd. Why don't I see the same here? Need to test on my other computer with Catalina.

@Valentina folks: any information? I need to have a solution soon.
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
Some additional information about my installation on MacOS :
- My vServer folder is installed in the user Documents folder
- it as the following permissions : theUser RW, myCustomGroup RW, everyone no access
Every account allowed to access to the server is included in myCustomGroup
The INI file is created by me and has the same permissions (but if I let Valentina server create this ini file automatically, the results are the same : I can change the settings)


My server is launched by a plist file stored in /Library/LaunchDaemons/ (permissions are the same as the parent folder)
In this plist file, I've added
<key>GroupName</key>
<string>myCustomGroup</string>
<key>Umask</key>
<integer>7</integer>

In the INI file, have you the HOSTINGMODE = 0 ?
(if <> 0 then vServer properties are not changeable)
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
That's not a typical installation of vServer.
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
Yes indeed.
I've done that in order to manage the backups myself (by the client app).
If the server is in a system owned folder (/Library/), I cannot use/create/delete other folders in the server folder via the client app as it don't have permissions to do so.
I want to make backup using the Valentina API (SQLExecute(BACKUP DATABASE)) and next move/copy to another location and manage older backup.

This configuration is working well, but I don't consider myself a server guru and perhaps I do that the wrong way.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Beatrix, it seems ValentinaServerUtility example is a bit "out of sync".

MAXCLIENTTIMEOUT is deprecated now, you should use MAXIDLECLIENTTIMEOUT variable instead.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Something like


SET PROPERTY MAXIDLECLIENTTIMEOUT OF SERVER to 30;
...
do restart
...
GET PROPERTY MAXIDLECLIENTTIMEOUT OF SERVER;
-- 30
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
François, I saw you bug report about "vServer's restart in Windows". I will take a look there a bit later.
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
BTW,
As I can see in the log file, the server is trying to terminate endlessly but is failing so ("Terminating the connection : FAILED";) and the log file is rapidly growing...


Could you send me the vServer log? Please do it with VerbooseMode == 3.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Now using the latest version 10.1.2. I'm still working with the Valentina Server Utility.

I was successful when changing the cache size. MAXIDLECLIENTTIMEOUT still doesn't want to be changed.

Why do I get an error 394507 after changing properties and restarting?
Anhänge
Kommentar
There are no comments made yet.
François Van Lerberghe Akzeptierte Antwort
FYI, In my variation of ValentinaUtility,
1) in DoServerRestart, I do

mValentinaServer.Restart
DisconnectFromServer

2) in DisconnectFromServer, I
- reset properties
- close the connection
- start a Timer to wait 1 second letting the server to restart
If I don't wait, I'm raising sometime an error

mValentinaServer = nil
mVConnection.Close
mVConnection = nil
// Update UI
...
// Wait 1 second before manually reconnect
myTimerConnection.Mode = 1
Kommentar
There are no comments made yet.
  • Seite :
  • 1
  • 2


There are no replies made for this post yet.
However, you are not allowed to reply to this post.