Hi,
I’m trying to run a small part of an autoyast install that failed in Leap 15.0, this just consist in creating a directory, as found in documentation here: AutoYaST Guide | openSUSE Leap 15.5
<?xml version="1.0"?>
<!DOCTYPE files>
<files xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns" config:type="list">
<file>
<file_owner>root</file_owner>
<file_path>/tftpboot</file_path> <!-- create directory -->
<file_permissions>777</file_permissions>
</file>
</files>
Putting above code in /path/to/files.xml for example and running
sudo yast2 ayast_setup setup filename=/path/to/files.xml dopackages="yes"
command in a terminal, I first tried with just file_path element as it is in documentation then added/removed file_permissions and/or file_owner but I always have following warning and the folder is never created:
These sections of AutoYaST profile cannot be processed on this system:
<file/>
kate
Maybe they were misspelled or your profile does not contain all the needed YaST packages in <software/> section.
I then tried it in Leap 15.1 since 15.0 is no more supported, but directory is still not created. Any one knows if there is another way to create “smoothly” a directory with autoyast ? I can do a script but this is ugly if autoyast should be able to do it from its configuration files.
Thanks
@antoinep:
Does “xmllint” indicate any errors in your AutoYaST control file?
Does “jing” indicate any errors in your AutoYaST control file? – “jing /usr/share/YaST2/schema/autoyast/rng/profile.rng <control file>”
@dcurtisfra:
Thanks a lot for your answer, *jing *was very helpful.
For *xmllint *I did not think to try but opened it with *Firefox *that usually points out issues, I’ll think about *xmllint *next time, anyway, there was no xml error neither in Firefox not with xmllint.
As for jing, as previously said it was very helpful, it pointed out that I had forgotten the profile element that must be root, here is the proper file:
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<files config:type="list">
<file>
<file_path>/tftpboot</file_path> <!-- create directory -->
<file_owner>root</file_owner>
<file_permissions>777</file_permissions>
</file>
</files>
</profile>
This was because the way our autoyast profile is made is having a main profile.xml with this profile element and other xml files for each relevant elements included, for example:
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="http://server/autoyast/files.xml"/>
<xi:include href="http://server/autoyast/services-manager.xml"/>
<!-- ... -->
</profile>
Anyway, even if with proper syntax I have no more error or warning with jing or at yast2 ayast_setup run, it is still not creating the directory.
With no errors written to the systemd Journal?
What happens if you run the AutoYaST profile manually? – <AutoYaST Guide | openSUSE Leap 15.5.
- You may have to get some help from “yast2 ayast_setup longhelp
” to setup some debug/trace options on the manual execution.
I didn’t look at systemd Journal, I’ll do so, an in fact I am running the profile manually to debug, it, I’ll then try again with “yast2 ayast_setup longhelp”.
Thanks.
So after some tries:
- Nothing found in journalctl
, - There is something in yast2log but I can’t see if trying to create a directory, just it cannot change owner and rights (cannot attach file then I put the interesting part here):
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/inst_autoconfigure.rb:140 current resource: files
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/inst_autoconfigure.rb:155 Writing configuration for files
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/inst_autoconfigure.rb:363 current step: 7 desc:Configuring files
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/inst_autoconfigure.rb:231 Calling auto client with: $“file_owner”:“root”, “file_path”:“/tftpboot”, “file_permissions”:“777”]]
2020-01-27 08:39:47 <1> 9912p9999(22867) [Interpreter] modules/Call.rb:44 Calling YaST client files_auto
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] yast/wfm.rb:308 Call client /usr/share/YaST2/clients/files_auto.rb
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/files_auto.rb:26 ----------------------------------------
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/files_auto.rb:27 Files auto started
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] modules/AutoinstFile.rb:78 Writing Files to the system
2020-01-27 08:39:47 <3> 9912p9999(22867) [bash] ShellCommand.cc(shellcommand):78 chmod: cannot access ‘/tftpboot’: No such file or directory
2020-01-27 08:39:47 <3> 9912p9999(22867) [bash] ShellCommand.cc(shellcommand):78 chown: cannot access ‘/tftpboot’: No such file or directory
2020-01-27 08:39:47 <3> 9912p9999(22867) [bash] ShellCommand.cc(shellcommand):78 cp: cannot stat ‘/tftpboot’: No such file or directory
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/files_auto.rb:103 Files auto finished
2020-01-27 08:39:47 <1> 9912p9999(22867) [Ruby] clients/files_auto.rb:104 ----------------------------------------
- I also tried giving it a file_location
to a folder on the server:
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<files config:type="list">
<file>
<file_location>http://myserver/autoyast/LEAP15_CONF/tftpboot</file_location>
<file_path>/tftpboot</file_path>
<file_owner>root</file_owner>
<file_permissions>777</file_permissions>
</file>
</files>
</profile>
But it results not in a folder creation but in a html file creation with folder content (empty here).
I then finally create the folder with a script since the “create directory” thing from autoyast files seems not working.