comparison util/startup.lua @ 14206:2b13c24ba2d6

Merge 13.0->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 28 May 2026 17:26:08 +0100
parents c1469296190d a874c3f4570a
children
comparison
equal deleted inserted replaced
14204:b226d326223d 14206:2b13c24ba2d6
640 os.exit(1); 640 os.exit(1);
641 end 641 end
642 end 642 end
643 end 643 end
644 644
645 -- Set our umask to protect data files
646 pposix.umask(config.get("*", "umask") or "027");
647 pposix.setenv("HOME", prosody.paths.data); 645 pposix.setenv("HOME", prosody.paths.data);
648 pposix.setenv("PROSODY_CONFIG", prosody.config_file); 646 pposix.setenv("PROSODY_CONFIG", prosody.config_file);
649 else 647 else
650 print("Error: Unable to load pposix module. Check that Prosody is installed correctly.") 648 print("Error: Unable to load pposix module. Check that Prosody is installed correctly.")
651 print("For more help send the below error to us through https://prosody.im/discuss"); 649 print("For more help send the below error to us through https://prosody.im/discuss");
731 for hostname in pairs(config.getconfig()) do 729 for hostname in pairs(config.getconfig()) do
732 prosody.hosts[hostname] = startup.make_host(hostname); 730 prosody.hosts[hostname] = startup.make_host(hostname);
733 end 731 end
734 end 732 end
735 733
736 function startup.posix_umask() 734 function startup.set_umask()
737 if prosody.platform ~= "posix" then return end 735 if prosody.platform ~= "posix" then return end
738 local pposix = require "prosody.util.pposix"; 736 local pposix = check_posix();
739 local umask = config.get("*", "umask") or "027"; 737 local umask = config.get("*", "umask") or "027";
740 pposix.umask(umask); 738 pposix.umask(umask);
741 end 739 end
742 740
743 function startup.check_user() 741 function startup.check_user()
942 startup.setup_plugin_install_path(); 940 startup.setup_plugin_install_path();
943 startup.setup_datadir(); 941 startup.setup_datadir();
944 startup.chdir(); 942 startup.chdir();
945 startup.read_version(); 943 startup.read_version();
946 startup.switch_user(); 944 startup.switch_user();
945 startup.set_umask();
947 startup.check_dependencies(); 946 startup.check_dependencies();
948 startup.log_startup_warnings(); 947 startup.log_startup_warnings();
949 startup.check_unwriteable(); 948 startup.check_unwriteable();
950 startup.load_libraries(); 949 startup.load_libraries();
951 startup.init_http_client(); 950 startup.init_http_client();
970 startup.load_libraries(); 969 startup.load_libraries();
971 startup.setup_plugindir(); 970 startup.setup_plugindir();
972 startup.setup_plugin_install_path(); 971 startup.setup_plugin_install_path();
973 startup.setup_datadir(); 972 startup.setup_datadir();
974 startup.chdir(); 973 startup.chdir();
974 startup.set_umask();
975 startup.add_global_prosody_functions(); 975 startup.add_global_prosody_functions();
976 startup.read_version(); 976 startup.read_version();
977 startup.log_greeting(); 977 startup.log_greeting();
978 startup.log_startup_warnings(); 978 startup.log_startup_warnings();
979 startup.load_secondary_libraries(); 979 startup.load_secondary_libraries();